Quantcast
Channel: Configuration and Deployment
Viewing all articles
Browse latest Browse all 3561

RE: RE: Re: IIS & ApplicationPath

$
0
0

For years now I've had a "PageRedirect" method that accepted a page name and correctly redirected my app to the specified page.  To be more precise, this method worked perfectly when Visual Studio was using its internal web server.

I'm now trying to run the app in IIS7 and peculiar things are happening.

For purposes of this example, I am configuring the Website Properties of my app thusly:

  • Use Local IIS Web server
  • Project URL: http://localhost/MyAppName

In the PageRedirect method essentially works like this:

  • string fullPath = Tools.EnsureSuffix(Tools.EnsurePrefix(HttpContext.Current.Request.ApplicationPath, "~"), "/");
  • fullPath += pageName;
  • HttpContext.Current.Response.Redirect(fullPath, true);

That last line of code is in a try..catch construct and an exception is occurring every time.

I'm confused as to whether I need to alter how PageRedirect creates the string to redirect to or whether I'm failing to do something correctly in Website Properties.

Hoping someone can offer some guidance.

Thank you,

Robert W.


Viewing all articles
Browse latest Browse all 3561


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>