Apr 7, 2007 #1 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.
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 Apr 8, 2006 728 0 0 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 Jun 5, 2006 53 0 0 US This doesn't work for image urls Upvote 0 Downvote
Apr 7, 2007 Thread starter #4 lawlegacy IS-IT--Management Jun 5, 2006 53 0 0 US NVM I need to use ASP:TableRow. Thanks Upvote 0 Downvote
Apr 8, 2007 #5 ninjadeathmonkey Programmer Mar 1, 2007 77 0 0 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 Sep 1, 2005 1,863 0 0 I would: <asp:Image ImageUrl="~/images/myimg.jpg" runat="server" /> Upvote 0 Downvote