Friday, October 8, 2010

MVC2 DropDownlist post on change event

master page

has to be exactly as written above, do not shortcut and just add the forward slash to the first script tag to close it.  Your jQuery will not work then.



 
Controller
        [HttpPost]
        public ActionResult MyAction()
        {
            //to do
            return View();
        }


View
<%
    using (Html.BeginForm("MyAction", "MyController", FormMethod.Post, new {@class="auto-submit"}))
    {
%>

     

    <%= Html.DropDownList("Text", (IEnumerable)ViewData["IntervalTime"]) %>

No comments: