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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative Links?

Status
Not open for further replies.

lawlegacy

IS-IT--Management
Jun 5, 2006
53
0
0
US
Is there an easy way to do relative links in 2.0 aspx files?
Relative links are needed for local development and production.
 
Sure, you use '~/' to indicate the root of the site, then you build your link.

Code:
hyperLink.NavigateUrl = "~/default.aspx";

as an example.
 
NVM I need to use ASP:TableRow. Thanks
 
I would:

<asp:Image ImageUrl="~/images/myimg.jpg" runat="server" />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top