Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IDE Compile Erro File Not Found From User Control 1

Status
Not open for further replies.

TallOne

Programmer
Joined
May 14, 2004
Messages
164
Location
US
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
 
<asp:HyperLinkLink id="mylink" navigateurl="~/page1.aspx" text="foo" enableviewstate="false" />

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Yes! The tilde. Soon as I seen your reply... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top