Skip to main content

Posts

Showing posts with the label how to redirect the page in mvc 5

how to redirect the page in mvc 5

Good and bad practice to use of Redirect URL in MVC  application  which are give below. Bad Practice : System.Web. HttpContext .Current. Response.Redirect ( url); Good Practice : System.Web. HttpContext .Current.Response.Redirect( url, false); System.Web. HttpContext .Current.ApplicationInstance.CompleteRequest() ; After redirect the response  URL  need a call as below line. System.Web. HttpContext .Current.ApplicationInstance.CompleteRequest() ; for more detail http://blogs.msdn.com/b/tmarq/archive/2009/06/25/correct-use-of-system-web-httpresponse-redirect.aspx