views:

234

answers:

1

I have two strange problems when I use routing in a web form application. Environment: IIS 7.5; .NET 4.0 and Windows 7 64 bit.

  1. default document does not work if I use (http://www.)mydomain.com. The exception message is "The controller for path '/' was not found or does not implement IController". However, if I debug in VS 2010 (http://localhost:8080), this problem has never come out. Here mydomain.com and http://localhost:8080 hit the same code in the same folder of the same computer. I trapped the value of request.path. When local host is used, the value is "default.aspx" while "/" if mydomain.com is accessed. I can use one line (if "/" then redirect to default.aspx) to "fix" the problem but I believe it should have a better way.

  2. when I detect request.path, I got such a VERY strange request which I have never seen before: 192.168.1.11/StableWSDiscoveryEndpoint/schemas-xmlsoap-org_ws_2005_04_discovery! I have no idea where it is from. I do not use any web service in my code. The request is posted to the server, and the user agent is WSDAPI. I tried to debug the code from a different browsers other than IE. It looks like I do not get such a request. Edit: I just found the 192.168.1.11/StableWSDiscoveryEndpoint/schemas-xmlsoap-org_ws_2005_04_discovery request is sent from the domain control.

Your help will be greatly appreciated.

A: 

Finally I got a solution to fix the first problem:

        routes.MapPageRoute(   
            "Default",                     
            "",                           
            "~/theactualpage.aspx"
        ); 

The idea is obtained from http://forums.asp.net/t/1439225.aspx

qiuyl