Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to send Model value as parameter while submitting @Ajax.Beginform()

$
0
0

Hi,

I am using @Ajax.Beginform in my View which is tightly bound to the ViewModel.

I've  @Html.ListBoxFor inside my form. I add and delete items from the listbox using jQuery. Now what I am want to achieve is that onpress of the submit button, it should send full data present in the listbox regardless of which are selected. Currently it sends the list to controller if  I select all the item in the listbox and press submit button. But I don't want to do that. Any idea as to how to achieve this?

Can it be sent as a form parameter. 

@using (Ajax.BeginForm("SaveTextComponent", "LoanFilterEditor", new{ param1 = Model.listBoxItem},  new AjaxOptions { HttpMethod = "POST", OnSuccess = "SUCCESS" }))

I try to accept the parameter in the controller like this

 public ActionResult SaveTextComponent(TextComponentViewModel model, List<SelectListItem> list)
{
}

But list is null.. Please help.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>