Click here to Skip to main content
15,908,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a page for saving the book details. After save i have to show a message Saved Successfully, Using the hidden field.
or using a popup window.



How can i do?
Please Help.
Posted
Comments
Zoltán Zörgő 8-Jul-13 8:47am    
Are using ajax to save, or you are posting the whole page to an action?
Jameel VM 8-Jul-13 9:00am    
Can you post the actionresult?

1 solution

You can set the message in ViewData or ViewBag in the ActionResult before you are saving like below
C#
public ActionResult Save()
{

//Save Logic here

ViewData["Message"]="Your Record saved successfully";
return View();
}

From the view you can take the viewdata value. For example put the ViewData message in the area you want to display the message.

C#
<span>ViewData["Message"]</span>


Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900