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
erum mirza
NA
428
0
i need to pass whole model from view to controler using ajax
Nov 8 2017 7:02 AM
can any one help me how to pass model object from view to controller using ajax .i have below code but not working.i am getting null in
EmpAddType .even i selected any thing from drop downlist
<script>
function GetFilter() {
var employeeAddress = {
"EmpAddType"
: $(
"#drop1 option:selected"
).text()
}
alert($(
"#drop1 option:selected"
).text());
alert(employeeAddress.EmpAddType);
$.ajax({
url:
'@Url.Action("SaveAddress")'
,
type:
'POST'
,
cache:
false
,
contentType:
'application/json'
,
dataType:
"json"
,
data: JSON.stringify(employeeAddress),
success: function (data) {
alert(
"You Multiple Data Passed Successfully"
);
},
error: function () {
alert(
"failed"
);
}
});
}
function showDiv() {
$(
'#MailingContactDetails'
).show(1000)
}
function showDiv2() {
$(
'#AccountDetail'
).show(1000)
}
</script>
Reply
Answers (
1
)
command injection prevention using c#
View engine in mvc required??