<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  <channel>
    <title>ASP.NET: Resolve Virtual Paths with a Simple Anchor Tag</title>
    <link>http://blogs.lotterypost.com/speednet/2007/9/aspnet-resolve-virtual-paths-with-a-simple.htm</link>
    <atom:link href="http://www.lotterypost.com/rss/blogcomments/18998" rel="self" type="application/rss+xml" />
    <description>Speednet's Blog: ASP.NET: Resolve Virtual Paths with a Simple Anchor Tag</description>
    <dc:language>en-us</dc:language>
    <generator>Lottery Post RSS Generator</generator>
    <item>
      <title>Original Blog Entry: ASP.NET: Resolve Virtual Paths with a Simple Anchor Tag</title>
      <link>http://blogs.lotterypost.com/speednet/2007/9/aspnet-resolve-virtual-paths-with-a-simple.htm</link>
      <guid isPermaLink="true">http://blogs.lotterypost.com/speednet/2007/9/aspnet-resolve-virtual-paths-with-a-simple.htm</guid>
      <pubDate>Sat, 22 Sep 2007 14:58:04 GMT</pubDate>
      <dc:creator>Speednet</dc:creator>
      <description><![CDATA[<p>Web developers have traditionally struggled with the issue of maintaining relative links throughout a web site that would always point to the correct folder/directory, no matter where the link was referenced from.</p><p>A relative link shows the web browser how to navigate up or down the folder structure of the site in order to get to the target page.</p><p>Lottery Post, being a very large and&nbsp;deep site,&nbsp;has this problem extensively.</p><p>For example, let's look at the link to the contact page located at <a href="http://www.lotterypost.com/contact.aspx" rel="external">www.lotterypost.com/contact.aspx</a>&nbsp;from a forum topic located at <a href="http://www.lotterypost.com/thread/161745" rel="external">http://www.lotterypost.com/thread/161745</a>.</p><p>As you can see, the contact page is located in the site's root folder, and the forum topic is located in a folder called &quot;thread&quot;.&nbsp; From the perspective of the forum topic, the contact page is located &quot;up&quot; in the folder structure (or &quot;down&quot; is you envision your root folder at the bottom), so a relative link would&nbsp;look like this:</p><p><span style="font-family: courier new,courier">&lt;a href=&quot;../contact.aspx&quot;&gt;Contact&lt;/a&gt;</span></p><p>The two dots and the slash (&quot;../&quot;) before the file name indicates that the browser needs to &quot;go up one folder&quot; to find the contact page.&nbsp; If I was viewing an individual post at <a href="http://www.lotterypost.com/thread/161745/887609" rel="external">http://www.lotterypost.com/thread/161745/887609</a>&nbsp;I would need to go up two folders, so I'd put &quot;../../&quot; before the file name.</p><p>When coding a huge site it becomes immensely difficult to maintain all those relative paths, especially when you decide to change the folder of a page.</p><p>For example, if I changed the topic page one level deeper (like <a href="http://www.lotterypost.com/forums/thread/161745" rel="external">www.lotterypost.com/forums/thread/161745</a>), I would need to remember to change the relative page to the contact page inside it.</p><p>With hundreds of links on every page, the problem is magnified.</p><p><strong>ASP.NET helps with &quot;Web application root operator&quot;</strong></p><p>ASP.NET introduced a tilde character (&quot;~&quot;) as a new operator called the &quot;Web application root operator&quot;.&nbsp; <strong>The operator only works with server controls.</strong></p><p>Its function....</p><p>[ <a href="http://blogs.lotterypost.com/speednet/2007/9/aspnet-resolve-virtual-paths-with-a-simple.htm">More</a> ]</p>]]></description>
      <category>* Original Blog Entry</category>
      <wfw:comment>http://www.lotterypost.com/blogentry/18998</wfw:comment>
    </item>
  </channel>
</rss>
