If i enter the details and click the save button it comes to the post action to save the data. Now i got 2 issues in that.
1) The Value of CustomerName will be null.
2) After i click create button in popup window after enter the details either it have to show the same popup window or it have to show the parent view i got issue in this step. In this place it redirect to main window of partial view. which is mentioned in below image. i tried my level best to explain my issue . please any one help me to resolve this issue.
Error Output

open: function(event, ui) {
$(this).load("@Url.Action("ContactPersonPartialView", "VisitorsForm")");
},
buttons: {
"Close": function () {
$(this).dialog("close");
}
}
});
$("#AddContactPerson").click(function () {
$("#AddNewContactPerson").dialog("open");
});
});public ActionResult ContactPersonPartialView()
{
ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "DisplayName");
return View("ContactPersonPartialView");
} public JsonResult ContactPersonCreate(VisitorsViewModel VVviewmodel)
{
ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "DisplayName", VVviewmodel.CustomerID);
var ContactIDObj = Guid.NewGuid();
var CustomerContactIDObj = Guid.NewGuid();
var CustomerContactObj = new CustomerContact()
{
CustomerContactID = CustomerContactIDObj,
CustomerID = VVviewmodel.CustomerID,
ContactReference = VVviewmodel.ContactPerson,
ContactID = ContactIDObj,
IsActive = true,
IsDeleted = false,
CreatedDate = DateTime.Now,
EditedDate = DateTime.Now,
LastActiveOn = DateTime.Now,
RowID = Guid.NewGuid(),
CreatedSessionID = Guid.NewGuid(),
EditedSessionID = Guid.NewGuid(),
OfflineMode = false,
OfflineID = Guid.NewGuid()
};
var ContactObj = new Contact()
{
ContactID = ContactIDObj,
DisplayName = VVviewmodel.CustomerID.ToString(),
PrintName = VVviewmodel.CustomerID.ToString(),
Phone1 = VVviewmodel.PhoneNo,
Mobile1 = VVviewmodel.MobileNo,
Email1 = VVviewmodel.Email,
Email2 = VVviewmodel.AlternateEmail
};
db.Contacts.Add(ContactObj);
db.CustomerContacts.Add(CustomerContactObj);
db.SaveChanges();
ModelState.Clear();
//return Json(new
//{
// redirectUrl = Url.Action("create", "VisitorsForm"),
// isRedirect = true
//});
return Json("VisitorsForm", JsonRequestBehavior.AllowGet);
}I posted my whole code here please any one check my code. In partial view the customer name will be null when i click create button and it didn't redirect correctly. i try my level best to explain my issue. please any one give solution for this problem.
Advance Thanks..
Answers
Know the answer? Post it. Somebody with the same question will find it here.