TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed salah
NA
530
148.4k
when pass variable ids from view to controller give me null
Oct 28 2016 9:52 AM
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())
{
<div>
<table id=
"tb"
></table>
<input type=
"submit"
value=
"save"
/>
<input type=
"text"
name=
"ids"
id=
"ids"
/>
</div>
<table id=
"tb"
>
</table>
}
see image to more clear understand enter image description here
Reply
Answers (
4
)
Pagination In Asp.net Core 1.0
im trying to genrate id asp.net using c# in access databse