shorriga
asked on
Failed to Map the Path, VB.NET User Control
In the application that I own, there are several times when an email will be automatically generated. This functionality works everytime except once. I believe the error in this one instance is due to a user control that is also involved in this particular functionality. For this particular email generation, a user goes into a particular page, fills out a comment in the user control located on this page, and submits the comment through the user control (generating an email).
How do I deal with path mapping errors, when user controls are involved?
How do I deal with path mapping errors, when user controls are involved?
What is the error specifically?
Also, using a ~ in your path, if it's not a server path, will tell your usercontrol to start at the root of your app. For instance, if you redirect to a page that is in /media/default.aspx, then from another folder, you could specify "~/media/default.aspx". If it is a server path that is not mapping correctly, then you may have other problems. Can you be more specific?
ASKER
Server Error in '/MyApplication' Application.
Failed to map the path '/MyApplication/SubFolder/ File.txt'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to map the path
This is the error. I think it is because I try to call the "File.txt" file from a sub in the user control. The code I use, works for all other triggered emails except this one that involves the user control.
Failed to map the path '/MyApplication/SubFolder/
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to map the path
This is the error. I think it is because I try to call the "File.txt" file from a sub in the user control. The code I use, works for all other triggered emails except this one that involves the user control.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried that in my code and it worked for a little while. Then it started crashign again. Any ideas?
Can I see the code for the control you are submitting from?
ASKER
I moved everything from the user control to the actual page and then ran the program. The call for the email trigger now works as the mapping does not get screwed up by the user control.
The "~" does help, but it was not the complet solution due to user control complications. If there was NO user control, it would have COMPLETELY fixed it.
THanks
The "~" does help, but it was not the complet solution due to user control complications. If there was NO user control, it would have COMPLETELY fixed it.
THanks