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

4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manas MohapatraPosted Oct 28, 2016, 12:14 PM
ahmed salahPosted Oct 29, 2016, 2:32 PM
Manas MohapatraPosted Oct 29, 2016, 12:42 AM
ahmed salahPosted Oct 28, 2016, 3:32 PM