Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ASP
Posted by: rajesh nagalingam
Added: Aug 15, 2018 9:59 PM
Views: 3
Tags: no tags
  1.   public ActionResult Index(string message)
  2.     {
  3.         if(!string.IsNullOrEmpty(message)){
  4.         ViewData["successmessage"]=message;  //Or you can use Viewbag
  5.         }
  6.         return View();
  7.     }
  8.  
  9.  [HttpPost]
  10.  public ActionResult Index()
  11.     {
  12.         ...............
  13.         return RedirectToAction("Index",new{ message="Saved successfully" });
  14.     }