views:

66

answers:

1

I have to host my project on iis6, I can not change iis setting on server. So, I modified global.asax like below.

If I add a default.aspx and browse project I got error like : The incoming request does not match any route.

if I dont add default aspx I got HTTP Error 403.14

have any idea? thanks

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


            routes.MapRoute("Default", // Route name
                  "{controller}.aspx/{action}/{id}",
                  new { controller = "Home", action = "Index", id = "" }  // Parameter defaults )
                  );
            routes.MapRoute("Detail", // Route name
                   "{controller}.aspx/{action}/{id}/{sid}",
                   new { controller = "Home", action = "Index", id = "", sid="" }  // Parameter defaults )
                   );
            routes.MapRoute("ForGoogle", // Route name
                   "{controller}.aspx/{action}/{friendlyUrl}/{id}/{partialName}",
                   new { controller = "Home", action = "Index", friendlyUrl = "", id = "", partialName =""}  // Parameter defaults )
                   );
            routes.MapRoute(
                    "PostFeed",
                    "Feed/{type}",
                    new { controller = "Product", action = "PostFeed", type = "rss" }
                );

        }
A: 

Add an index.htm file which redirects to the right page. This has a side advantage: it does not require the webapp to be started, so it is possible to show an image or text while the webapp is started for the first time.

A fancy jquery "loading..."-page I use in some projects:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
  <title>(loading...)</title>

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;

  <script type="text/javascript">
   $(document).ready(function() {
     $.ajax({ type: 'GET', url: 'Home.aspx', success: function() { location.href = 'Home.aspx'; } });
   });
  </script>

</head>
<body>
 <div id="loading">
   (show "loading..." text here)
 </div>
</body>
</html>
Jan Willem B