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
Abhilash J A
530
2.4k
599k
MVC 5 - viewmodel object not binding view issue.
Mar 1 2017 3:47 AM
Hello Everyone,
This Ajax call on button click,
$(
'#idProject'
).click(
function
() {
var
idProject = $(
this
).attr(
'name'
);
$.ajax({
url:
"/UserRegister/GetProjectByID?projectid="
+ idProject,
type:
"POST"
,
success:
function
(result) {
//alert(result);
}
});
});
View page,
@model Reboxwebapp.Models.ViewModel.PartnerProjectVM
@Html.TextBoxFor(model => model.ProjectName,
new
{ @id =
"first_name"
, @
class
=
"form-control input-sm "
, @placeholder =
"Project Name"
})
/*---here, model object continuing---*/
And controller actionresult.
[HttpPost]
public
ActionResult GetProjectByID(
int
projectid)
{
PartnerBIL objPartnerBIL =
new
PartnerBIL();
PartnerProjectVM partnerProjectVM =
new
PartnerProjectVM();
var PartnerProjectBL = objPartnerBIL.GetProjectByID(projectid)
as
PartnerProjectBL;
partnerProjectVM.idPartnerProject = PartnerProjectBL.idPartnerProject;
partnerProjectVM.ProjectName = PartnerProjectBL.ProjectName;
partnerProjectVM.ProjectDescription = PartnerProjectBL.ProjectDescription;
partnerProjectVM.ProjectType = PartnerProjectBL.ProjectType;
partnerProjectVM.Status = PartnerProjectBL.Status;
partnerProjectVM.CompletionYear = PartnerProjectBL.CompletionYear;
partnerProjectVM.ProjectLocation = PartnerProjectBL.ProjectLocation;
partnerProjectVM.ClientName = PartnerProjectBL.ClientName;
return
View(
"PremiumUserRegProjects"
, partnerProjectVM);
}
Please help me...
Reply
Answers (
5
)
How to check whether a data table exists in data set?
Button click event not get fired