MVC3: How to get the text box value as parameter?
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I'm new in MVC3 and have a simple question. I have Index.cshtml file (view) with 2 controls text box and hyper link: @Html.TextBox("contId") @Html.ActionLink("Query", "Query") In controller class I'd like to have an action that handles clicking hyper link and getting the value of text box above in order to use it in LINQ construction as follows:
public ActionResult Query()
{
// How to get text box value?
int cid = ... ?var data = from continents in db.Continents where continents.ContinentID == cid select continents; return View(data);
}
The result of LINQ query should be displayed on next view. Thank you in advance. Goran