Hi
I have a problem related to global.asax and the Server.Mappath-Method.
I collect all unhandled errors in the Application_Error in
Global.asax.
According to the type of error I redirect/transfer the user to the
correct error page.
DataException --~/DBError.aspx
HttpException --~/XyxError.aspx
This works fine for the redirect or transfer. But INSIDE the loaded
error page my ~/Xyz.gif or ~/Xyz.aspx are mapped wrong (including the
subfolder), if the originally error happend in a subfolder of the main
app.
http://www.myurl.com/PageThatRaisedTheError.aspx --everything is ok
http://www.myurl.com/SubFolder/PageT...dTheError.aspx -->
Error.aspx is loaded, but every link inside Error.aspx starting with
~/ is resolved as http://www.myurl.com/SubFolder/ instead of http://
www.myurl.com/
It looks like that my base directory change to the subfolder, so that
Mappath interprets the subdirectoy as application base.
On my development machine (development server, latest Patches for VS
2005 installed) everything works fine, but on my hosting machine (IIS)
the problem appears.
Has someone any idea or solution? My search on the forums didn't
helped me ... maybe you?
Thanks
Michael