Search code examples
c#ajaxasp.net-mvcrazorstrongly-typed-view

Ajax begin form not picking up strong type drop down list value


I am using Ajax begin form for a search page to bring back results. I have the following markup.

@using (Ajax.BeginForm("GetSearchResults",
                "MYController",
                new
                {
                    siteID = Model.SiteID
                },
                new AjaxOptions()
                {
                    HttpMethod = "GET",
                    AllowCache = true,
                    InsertionMode = InsertionMode.Replace,
                    UpdateTargetId = "search-reults"
                }))  
{    
    @Html_DropDownListFor(model => model.SiteID, Model.StatusCollection)
}

There are a few other strong type textboxes and a submit button on the page. All textboxes submit data back to the controller but the drop down list doesn't. It always submits the default value 0. Are there any other steps I need to do to pick up the value or something in the JQuery onchange event?


Solution

  • Removing the route parameter siteID worked. I do not need to pass strong type control values through as route parameters.