well, it's been a few weeks since I started programing in ASP.NET MVC and i came across with several issues, i have followed the tutorial microsoft introduction in this link:
http://www.asp.net/mvc/overview/getting-started/introduction/adding-search
there are 3 things that i cant understand very well
1 - In the example about the search in ASP.NET i cant get it how the searchString is passed from the form in the view to the controller
public ActionResult Index(string searchString) //this searchString in the controller
{
var movies = from m in db.Movies
select m;
if (!String.IsNullOrEmpty(searchString))
{
movies = movies.Where(s => s.Title.Contains(searchString));
}
return View(movies);
}
Razor Syntax
@using (Html.BeginForm()){
<p> Title: @Html.TextBox("SearchString") <br />
<input type="submit" value="Filter" /></p>
}
Where the view send the string to the controller???
2 - var movies = from m in db.Movies select m;
what is this strange syntax, where can i learn it, what means that m ?? i learned sql syntax and it is a little different from that :S.
3- the lambda expressions in this case how it works ???
for exemple: movies = movies.Where(s => s.Title.Contains(searchString));
well what i really need in this case is that someone explain me what i asked and how the flow in this case works cause its kinda confusing thanks :)``