Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
MVC 5 - viewmodel object not binding view issue.
Mani Kandan
Mar 1 2017 3:47 AM
269
Reply
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...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
How to check whether a data table exists in data set?
Button click event not get fired