title: Why css & image get distorted on URL rewrite in asp.net?
body: <p>I have a .aspx page which shows item list. Currently it displays <code>www.site.com/Catalog.aspx?mid=228</code> which need to be <code>www.site.com/CellPhone/blackbery/sprint/Q10.aspx</code>. All items are displayed in DataList and on button click the Hyperlink redirect to <code>Catalog.aspx</code> with query string 'id' which is the device id.</p>
  
  <p>Now, I have build URL for LinkButton as <code>'CellPhone/blackbery/sprint/228'</code> dynamically and for other items too.</p>
  
  <p><strong>Above link redirect and URL changes but css get disturbed. &amp; i want to dynamically rewrite all links and not to hardcode as above.</strong></p>
  
  <p><strong>css Reference:</strong></p>
  
  <pre><code>&lt;link href="css/layout.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="css/reset_font_grid.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="css/buttons.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="css/inner-pages.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'&gt;
  </code></pre>
  
  <p><strong>Catalog.aspx</strong></p>
  
  <pre><code>&lt;asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="/cellphone/blackberry/sprint/228.aspx"&gt;Show Cellphones asdfsdf&lt;/asp:HyperLink&gt;
  </code></pre>
  
  <p><strong>Global.asax</strong></p>
  
  <pre><code>&lt;%@ Application Language="C#" %&gt;
  &lt;%@ Import Namespace="System.Web.Routing" %&gt;
  &lt;script runat="server"&gt;
      void Application_Start(object sender, EventArgs e)
      {
          // Code that runs on application startup
          RegisterRoute(System.Web.Routing.RouteTable.Routes);
      }
  
      void RegisterRoute(RouteCollection routes)
      {
          //http://aspsnippets.com/Articles/How-to-hide-remove-ASPX-extension-in-URL-in-ASPNet.aspx
          routes.MapPageRoute("44", "{cat}/{carrier}/{devices}/{id}.aspx", "~/Catalog.aspx");
      }
  }
  </code></pre>
  
  <p><strong>All works fine but just the css on the page &amp; images is not applied!</strong></p>