473,545 Members | 937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with Server.Mappath after Error handled in Global.asax (not the missing ~-problem!)

Hi

I have a problem related to global.asax and the Server.Mappath-Method.

I collect all unhandled errors in the Application_Err or 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

Feb 3 '07 #1
0 1259

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
14351
by: A P | last post by:
I receive an error like this: Server.MapPath() error 'ASP 0172 : 80004005' Invalid Path /conn.asp, line 2 The Path parameter for the MapPath method must be a virtual path. A physical path was used.
1
4593
by: Neil | last post by:
Hello - In every project I try to compile and run, I'm getting a parser error on global.asax (pasted below). I have rebuilt and recompiled, and this happens on every project on my machine, no matter how simple or complex. For example purposes, I even created a new app using all the defaults in VS.Net 2003 (WebApplication1, WebForm1) and...
0
912
by: YaKs | last post by:
Hi, I am trying to handle th HttpException raised when you upload a file too big. I changed the property maxRequestLength and I set it to 10000, but I what to notice the user that the file is too big. Finally I could handle this error at global.asax level, but when I try to tranfer to the same page including an error flag in the session, it...
2
2333
by: tshad | last post by:
I have my error handling set up in Global.asax: Sub Application_Error(Sender As Object, E as EventArgs) In this procedure I call a function in a dll that will write out to a history file. This works for some errors, but not others. If it doesn't work, it stops there and the normal MS error page goes to the User.
8
3534
by: Doug | last post by:
Visual Studio 2005, SQL Server 2000, ASP.NET/VB.NET Not allowed to use the ASPNET machine account in SQL Server (very strict environment). Need to use Windows authentication, so we use "Identity Impersonate=true" in the web.config file. Trying to implement a system-wide error trapping mechanism. Nothing fancy, just writing to a log...
5
1397
by: Eric Layman | last post by:
Hi everyone, Currently Im using Global.asax.vb to capture any errors and to send them via email to me. But I didn't get any emails when I purposely crash the web application. May I know what I am missing here? I've copied (shamelessly) the script from here:...
0
1128
by: JB | last post by:
Lots of problems ive managed to work through, but this one is causing me much grief. Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type...
4
10259
by: Joe | last post by:
Hello all! I added a Global.asax to my application. I'm using the Application_BeginRequest event. Everything works fine in my development enviorment but when I publish the web site the Global.asax file doesn't get published. If I manually copy it the event doesn't seem to get called. Any idea what's going on here? Thanks,
1
3360
by: kyrillos | last post by:
hello, i get the common error message when using the Server.MapPath() error. which is Server.MapPath() error 'ASP 0173 : 80004005' Invalid Path Character An invalid character was specified in the Path parameter ..... My question is, how can i handle this error message. in other words, i would like the server in this case to display a...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1879
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.