ASP.Net MVC Razor Dropdownlist with submit button postback

Viewed 9382

First off, I am new to ASP.NET MVC and having a hard time finding good resources (API?) for it. So my question comes two-fold:

I want to try and get my dropdownlist to not auto-postback. Instead, I'm trying to get the dropdownlist to simply select an item, and then allow a submit button to submit the GET request.

So if the code example I am looking at looks like this:

 @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "TheForm" })){
     @Html.DropDownList(
         "CategoryID", 
         (SelectList) ViewData["Categories"], 
         "--Select One--", 
         new{ onchange = "document.getElementById('TheForm').submit();" }
     ) 
 }

how do I alter this to instead put a a submit button to do a GET request?

Secondly, anyone have any good literature that would resemble some sort of API for razor?

1 Answers
Related