Hello ppls! Hope you can help.
I have a user control that contains an href to a file in the root of my project.
User Control
MyProject/Controls/NavBar.ascx
User control contains this code...
<A href="Page1.aspx">Page1</A>
The location of Page1.aspx:
MyProject/Page1.aspx
The control is used in a file here
MyProject/Page2.aspx
and when ran, the file is found in local debug and when published on the server.
Relative to the controls folder the file cannot be found.
When building my solution, I get an error
File 'Page1.aspax' was not found.
It's not a show stopper and I can turn off the validation in html to get rid of the error, but I really want to code this correctly and like to see what html validation errors I recieve for IE6(it's amazing the number of errors I got converting from .Net 1.1 to 2.0 it actually exceeded the max allowed but that's another story!).
I can use
<A href="../Page1.aspx">Page1</A>
and the validation on build is happy, but when placed on the server, this does not work because the control is on a page that does not need to go up a directory(another virtual directory).
I could use this
<A href="../MyVirtual/Page1.aspx">Page1</A>
But MyVirtual may not be THAT exact name for each server install.
Does anyone know the best way to resolve this?
TIA,
TallOne
I have a user control that contains an href to a file in the root of my project.
User Control
MyProject/Controls/NavBar.ascx
User control contains this code...
<A href="Page1.aspx">Page1</A>
The location of Page1.aspx:
MyProject/Page1.aspx
The control is used in a file here
MyProject/Page2.aspx
and when ran, the file is found in local debug and when published on the server.
Relative to the controls folder the file cannot be found.
When building my solution, I get an error
File 'Page1.aspax' was not found.
It's not a show stopper and I can turn off the validation in html to get rid of the error, but I really want to code this correctly and like to see what html validation errors I recieve for IE6(it's amazing the number of errors I got converting from .Net 1.1 to 2.0 it actually exceeded the max allowed but that's another story!).
I can use
<A href="../Page1.aspx">Page1</A>
and the validation on build is happy, but when placed on the server, this does not work because the control is on a page that does not need to go up a directory(another virtual directory).
I could use this
<A href="../MyVirtual/Page1.aspx">Page1</A>
But MyVirtual may not be THAT exact name for each server install.
Does anyone know the best way to resolve this?
TIA,
TallOne