Problem in server side(controller)
pass value of ids from view to controller give me null value in controller when i check in break point although it have value in client side jquery
- public ActionResult Edit(FormCollection form)
- {
- // check string ids give me null value although text box ids have value in view
- string ids = form["ids"];
- return View();
- }
This variable ids represent as text box in view and i check it in view it have values. this text box have values after i remove courses from table it send removed courses ids to text box ids .
- $("#tb").on("click", ".r", function () {
- $(this).parent().parent().hide();
- $(this).parent().prev().prev().find("input").addClass("remove");
- var ids = [];
- var i = 0;
- $(".remove").each(function () {
- ids[i] = $(this).val();
- i++;
- });
- $("#ids").val(ids);
- });
- @using (Html.BeginForm())
- {
"tb">
- "submit" value="save" />
- "text" name="ids" id="ids" />
"tb">
- }
see image to more clear understand enter image description here



Manas MohapatraRank #182 · 13.2K reputationPosted Oct 28, 2016, 8:14 AM EDT
ahmed salahRank #2,612 · 534 reputationPosted Oct 28, 2016, 11:32 AM EDT