...

View Full Version : relative url is being returned incorrectly



gretch
03-21-2007, 08:03 PM
I’m receiving the following error from my ASP.Net application:
“Exception of type System.Web.HttpException was thrown.
C:\Inetpub\Www_root\rtcwebapp_v2\products\secure\login.aspx”

This error is usually accompanied by a “File Not Found” error for the following file:
“/products/secure/login.aspx”

In my code, I’m using relative urls:
Ex: ("~/secure/login.aspx")

For some reason the relative url is being returned incorrectly. I noticed that the “products” directory is being added to the web application’s root. The web application path is “C:\Inetpub\Www_root\rtcwebapp_v2” but when there is an error the application path is “C:\Inetpub\Www_root\rtcwebapp_v2\products”.

The errors only occur when “products” is included in the path. The error doesn’t happen all the time and it is happening on various pages, not just one. The IIS is configured with “C:\Inetpub\Www_root\rtcwebapp_v2” as the web application directory. I can’t figure out why the extra “products” directory is appearing in the file path! Any insight into this problem would be greatly appreciated. Thank you for your time.

gretch

Krokador
03-28-2007, 04:49 PM
asp.net might have decided to add your products directory as an aplication on its own, thus the relative url will point to root of the product directory. As for how to change that behavior, I'm not too sure where the configuration for that is, I never ran into that problem myself. maybe a google search on aspnet application pool or aspnet_Application_CreateApplication stored procedure or other application path related stuff would give you better results than me ^^.

gretch
03-30-2007, 03:13 PM
Thanks for the clues. I'll see what I can find!

gretch



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum