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) {
-
- }
- });
- });
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...