51 things that have been busy with Android until now finally have a chance to catch my breath, so I took the time to write this blog, to record my previous study of MVC after a week to write a small example: Search Taobao products and price screening products.
First start the interface:
The source code for this interface is as follows:
@{
viewbag.title = "Home page";
}
<script src= "@Url. Content (" ~/scripts/jquery.validate.min.js ")"
type= "Text/javascript" ></script>
<script src= "@Url. Content (" ~/scripts/jquery.validate.unobtrusive.min.js ")"
type= "Text/javascript" ></script>
@using (Html.BeginForm ()) {
<fieldset>
<legend>Search</legend>
<p id = "Editor-field" >
<p> Search for merchandise @Html. TextBox ("keyword")
</p> <p> Price limit @ Html.textbox ("Max") </p>
<p> Lower price @Html. TextBox ("min") </p>
</p>
</ fieldset>
<p>
<input type= "Submit" value= "Search"/>
</p>
}
It is noteworthy that I marked the Code red, the textbox provides user input, and submits the user input, "keyword" in parentheses is used to identify the submitted content, so that we can extract the user's input from the submitted form.