Q:

How to pass textbox from view to it's own controller again and again?

What I'm trying to do is to pass the value of the textbox of this certain view to it's own controller.
The view has only 1 textbox, the textbox for id , then the controller has linq query that search the database that match that id.
So when I run my program , first it would show empty gridview and empty textbox. What I want to do is when I input a text in the textbox and press submit , it would call it's own controller and pass the value of the textbox that contains the id so the linq query will have something to use so it can display a search result.
Did I make sense ? :0 sorry I'm a just a beginner.

A:

You can get that Text box value using form Collection, Foe Ex,your view may look like this
@model MvcMovie.Models.Movie

@{
ViewBag.Title = "Create";
}

@using (Html.BeginForm("controllerName","ActionName",FormMethod.Post)) 
{
@Html.ValidationSummary(true)

<fieldset>
    <legend>Movie</legend>

    <div class="editor-label">
        @Html.TextBox("Name",null,New {id="Name"})
    </div>

<div class="editor-label">
        <input type="submit" value="save" />
    </div>
</fieldset>
}

In controller,
[HttpPost]
Public ActionResult MethodName(FormCollection form)
{
string name = form["Name"];

// name contains your textbox value
}

