vb.net - Pass model to MVC controller -


so i'm having issue passing param through controller.

when ajax.beginform , pass in follows:

<% using ajax.beginform("multiprocess", "orders", new multiprocessrequestviewmodel {.searchparams = model.searchparams},new ajaxoptions {.updatetargetid = "ordersoutput", .onsuccess = "afterread", .loadingelementid = "readingorders"})%> 

the value appears 'nothing'.

however on same page if following:

<%=new javascriptserializer().serialize(model.searchparams) %> 

to try , gauge if value set. can see value indeed set , correct.

the entire section reference:

<% using ajax.beginform("multiprocess", "orders", new multiprocessrequestviewmodel {.searchparams = model.searchparams}, new ajaxoptions {.updatetargetid = "ordersoutput", .onsuccess = "afterread", .loadingelementid = "readingorders"})%>     <%=new javascriptserializer().serialize(model.searchparams) %>          <div>             <%=html.hidden("searchparams", model.searchparams) %>             <%=html.hidden("test", "just in case") %>             <%=html.dropdownlist("process", model.processes)%>             <input type="submit" value="process selected items" class="formbutton" id="btnmultiprocess" />             <br />         </div>    <%  end using %> 

the test , process params both work. here model reference:

public class multiprocessrequestviewmodel     public property searchparams new orders.ordersearchfilters     public property process string     public property selecteditems new list(of string)     public property test string  end class 


Comments

Popular posts from this blog

c# - Get the Class name in a class with atribute inside a attribute method -

javascript - Why Selenium can't find an element that is graphically visible -

java - How to compare two classes -