Language: C#
Fix WebFormViewManager problem with Request.ApplicationPath (UIP Block)
private void RedirectToNextView(string previousView, ViewSettings viewSettings) { try { if( previousView == null ) // Fix HttpContext.Current.Request.ApplicationPath because doesn't work well whe application is in root directory // when application is under root ApplicationPath returns "/" // when application is under sub foder ApplicationPath returns "/sub folder" // so remove end "/" // see http://weblogs.asp.net/dneimke/archive/2004/05/17/133116.aspx // http://www.cptloadtest.com/2006/07/26/RequestApplicationPath-Is-Evil.aspx HttpContext.Current.Response.Redirect( HttpContext.Current.Request.ApplicationPath.TrimEnd('/') + "/" + viewSettings.Type, true ); else HttpContext.Current.Response.Redirect( HttpContext.Current.Request.ApplicationPath.TrimEnd('/') + "/" + viewSettings.Type , false ); } catch(System.Threading.ThreadAbortException) {} }
Tags:
Description:
When web application is under root UIP block doesn't resolve view location well. This little change on Microsoft.ApplicationBlocks.UIProcess.WebFormViewManager.RedirectToNextView method fixes the problem.
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

