Routing not working on hosting server

Hi All,

Now routing is a common solution in for URL rewrite. I have used it in many application. application with routing always runs fine on development server. I noticed that sometimes my routes were not working when the application is deployed on the hosting server.

If you will face this kind of problem then use below settings in web.config file. I have configure the UrlRoutingModule and the UrlRoutingHandler in the web.config file manually

    <modules runAllManagedModulesForAllRequests="true">
      <remove name="UrlRoutingModule"/>
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        verb="*" path="UrlRouting.axd"
        type="System.Web.HttpForbiddenHandler, System.Web,  
          Version=, Culture=neutral,  
        <add value="index.aspx" />

image path problem with routing in website

When we are applying routing with parameters in 3.5 then images are not displayed due to wrong path of images.

So we have to change the code for assiging image path in following way.

In aspx page

<img src="images/icon_first.gif" alt="" /> is replaced by <img src='<%= ResolveUrl("~/images/icon_first.gif") %>'  alt="" />

Same way, in javascript

 $get(obj).src ="images/button_qittop.jpg"; is replaced by $get(obj).src = '<%= ResolveUrl("~/images/button_qittop.jpg") %>';