Apr 7, 2007 #1 lawlegacy IS-IT--Management Joined Jun 5, 2006 Messages 53 Location US Is there an easy way to do relative links in 2.0 aspx files? Relative links are needed for local development and production.
Is there an easy way to do relative links in 2.0 aspx files? Relative links are needed for local development and production.
Apr 7, 2007 #2 tperri Programmer Joined Apr 8, 2006 Messages 728 Location US Sure, you use '~/' to indicate the root of the site, then you build your link. Code: hyperLink.NavigateUrl = "~/default.aspx"; as an example. Upvote 0 Downvote
Sure, you use '~/' to indicate the root of the site, then you build your link. Code: hyperLink.NavigateUrl = "~/default.aspx"; as an example.
Apr 7, 2007 Thread starter #3 lawlegacy IS-IT--Management Joined Jun 5, 2006 Messages 53 Location US This doesn't work for image urls Upvote 0 Downvote
Apr 7, 2007 Thread starter #4 lawlegacy IS-IT--Management Joined Jun 5, 2006 Messages 53 Location US NVM I need to use ASP:TableRow. Thanks Upvote 0 Downvote
Apr 8, 2007 #5 ninjadeathmonkey Programmer Joined Mar 1, 2007 Messages 77 Location US It works on anything you put runat="server" on. so you can do Code: <img src="~/images/myimg.jpg" runat="server" /> and this will work. Ron Wheeler http://www.tekdev.com/ Upvote 0 Downvote
It works on anything you put runat="server" on. so you can do Code: <img src="~/images/myimg.jpg" runat="server" /> and this will work. Ron Wheeler http://www.tekdev.com/
Apr 8, 2007 #6 TipGiver Programmer Joined Sep 1, 2005 Messages 1,863 I would: <asp:Image ImageUrl="~/images/myimg.jpg" runat="server" /> Upvote 0 Downvote