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
Praveen Kumar
NA
235
22.2k
How to call second Action result in first Actionresult?
Apr 11 2020 6:41 AM
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit(ContactDetailViewModel model)
{
try
{
User user = _Login.GetCurrentUser();
using (var dbContextScope = _dbContextScopeFactory.Create())
{
Contact contact = model;
_ContactRepo.UpdateContact(contact, user);
dbContextScope.SaveChanges();
}
}
catch (RMException rme)
{
rme.Log();
ModelState.AddModelError("", "Saving contact failed. Please check your values and try again.");
return PartialView(model);
}
catch (Exception)
{
ModelState.AddModelError("", "Saving contact failed for an unknown reason. Please check your values and try again.");
return PartialView(model);
}
return RedirectToAction("Index", "Contact");
}
-----------------------------------------------------------------------------------------------------------------------------------
public ActionResult UpdateContactAttribute(int key, String values)
{
using (var dbContextScope = _dbContextScopeFactory.Create())
{
var dbAttribute = _ContactRepo.GetContactAttribute(key);
ContactViewModel.ContactAddressViewModel cvm = dbAttribute;
JsonConvert.PopulateObject(values, cvm);
User user = _Login.GetCurrentUser();
_ContactRepo.UpdateContactAttribute(cvm, user);
dbContextScope.SaveChanges();
}
return new HttpStatusCodeResult(HttpStatusCode.Created);
}
Reply
Answers (
1
)
When i am trying to change some values update not happening
Crystal report Nextpage Go Next Page Not working