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
Rahul Lakshakar
NA
199
41.6k
Pass Model data from view to controller using ajax
Nov 15 2018 11:07 PM
Hello Sir,
I am trying to pass model data from view to controller but it's not working. Infact it's not firing the action in controller.
Please help and guide me.
Thanks
My Code like this:
#MODEL
public class model{
report objReport = new report();
model = new model()
{
objReport = new report();
}
}
public class reoprt{
public int reportID {get;set;}
}
#CONTROLLER
public string save(model objModel)
{
return "done";
}
#AJAX CALL
var objDailyReport = $("#CNform").serialize();
$.ajax({
type: "POST",
url: "/dailyreportingregister/Save",
data: objDailyReport,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert("done");
}
});
Reply
Answers (
3
)
User account Branch selection
Site can’t be reached