Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
After doing insert or update i need to Reload list box to Get Updates for that i need to Reload the page or part of the page

How to Refresh(Reload) a page in MVC4 Razor?
Posted
Comments
Manoj Kumar Choubey 28-Nov-13 0:19am    
do you want to refresh listbox only or all page ?

You can use JavaScript after successfully your code executed
window.location.reload();
 
Share this answer
 
Just use again same action name with controler name
Use this
RedirectToAction("Create", "ControlerName");
instead of
return View();
 
Share this answer
 
v2
If you want to refresh all page then you can use 


C#
return RedirectToAction("ActonName", "ControlerName");
return View(objectname);


And if you want to reload listbox only as you explained in your question. like following links.

http://stackoverflow.com/questions/18254749/updating-partialview-mvc-4[^]
 
Share this answer
 
Comments
[no name] 13-Dec-13 15:54pm    
@Html.Action("ActionName","ControllerName")

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