Hello,
I need to persist the selected value of my igCombo on postback when the submit button is clicked, I am using Asp.Net MVC
I have followed this approach but I am getting null in my int[] comboProducts parameter in my [HttpPost] method. please see the code below, Why am I getting null in the action method parameter.
-----------------------------------
In my Controller:
[HttpGet] public ActionResult ComboTest() { return View(); }
[HttpPost] public ActionResult ComboTest(int[] comboProducts) // I am getting null here { ViewBag.ProductComboSelectedItems = comboProducts; return View(); }
------------------------------------
In my View:
}
-----------------------------------------------------------------------
Please point out where am i going wrong. I cannot seem to understand why am I getting null as parameter.
I understand how it is going to work but I dont want to use ComboFor() because this would require me to provide the model using the @model directive at the top.
In my case the igCombo is in a partial View & the parent View is already getting a @model Infragistics.Web.Mvc.GridModel on top therefore I cannot supply it with another comboModel. Therefore I was hoping to do the same thing using @(Html.Infragistics().Combo("Combo1") & supply it with DataSourceUrl instead of DataSource, BUT I cannot set the id of the combo which is causing issues i think.
The same issue is being discussed in another thread on the same forum , I was hoping I could get that fixed before I move on to the persistance & autopostback issue because all the delegates require me to provide an id of the combo to them , but I cannot set the id of combo in my View, I am getting a null reference exception, Dont know why.
Thanks for your response though.
Hello, Omer.
Thank you for using our products and I hope that my answer will help you resolve that case.
You can try the ComboFor method, which is supposed to be used, when you want to send Combo value to the server. Please check this sample and see if it works for you. I will wait for your feedback.
Best regards,
Nikolay Alipiev