Programming, Web News, Web Hostings, Technology
Archive for September, 2009
ASP.NET MVC – How to have multiple submit button in form
Sep 25th
In this tutorial, I would like to share simple form POST submit in ASP.NET MVC. The scenario is whenever your have have multiple submit button, you have to set each of the submit button value to be different.
End result page in your home page will containing two button (Search and Save button) in the same form.
Form above is rendered from HTML code behind as shown below
Create a new controller named “ProductController” in controller folder; Create a new folder named “Product” in “Views” folder, following by adding two new views (Save.aspx and Search.aspx)
Open up your “ProductController”, create three method as following (Edit, Search and Save)
You can download the sample code from here
ASP.NET MVC – How to implement querystring
Sep 24th
In this tutorial, I would like to share with you on how to create a simple query string in ASP.NET MVC with a very simple product listing page. End result of the query string would look something like below
http://localhost:1748/Product/Listing/Kitchen?page=4
or http://localhost:1748/Product/Listing/Kitchen
In your Global.asax, add new route
Create a new folder “Product” and create a new view “Listing”
In the content area, display product and page
Create a new controller name “ProductController” and create a new method “Listing”
You can download the sample code here









