mari muthu

mari muthu

  • NA
  • 198
  • 107.4k

how to display the save succeessfull message in MVC ?

Apr 6 2016 5:28 AM
 
  I have give code for saving Action...in this ,After save the data some successfull message has to
display ..  in this code i had wrote return success in that place i passed one message you seen.that message only display after am saving my page  ....please help me if anyone know this please share the code please help me 
 
 
 
public ActionResult RoundOff(RoundoffSetting model)
{
try
{
var item = (from a in wallet.RoundoffSettings where a.CompanyId == CompanyId select a).FirstOrDefault();
if (item == null)
{
item = new RoundoffSetting();
item.CompanyId = CompanyId ?? 0;
item.CreatedBy = User.Identity.Name;
item.CreatedDate = DateTime.Now;
wallet.RoundoffSettings.Add(item);
}
else
{
item.ModifiedBy = User.Identity.Name;
item.ModifiedDate = DateTime.Now;
}
item.RoundingType = model.RoundingType;
item.RoudingValue = model.RoudingValue;
wallet.SaveChanges();
return Success(M("RoundOffSaveSucess"));
}
catch (Exception e)
{
log.Error("Failed to save RoundOff", e);
return Error();
}
}

Answers (5)