ASP.NET MVC routing issue with Google Chrome client

前端 未结 3 583
死守一世寂寞
死守一世寂寞 2021-01-16 01:21

My Silverlight 4 app is hosted in ASP.NET MVC 2 web application. It works fine when I browse with Internet Explorer 8. However Google Chrome (version 5) cannot find ASP.NET

相关标签:
3条回答
  • 2021-01-16 01:38

    This doesn't directly answer your question, but I would suggest you try Fiddler, and look at the actual request that is being sent by the browser. Compare the differences and try to figure out what's going wrong (you can use the "Request Builder" tab in Fiddler to eh-hm, fiddle with the parameters).

    0 讨论(0)
  • 2021-01-16 01:42

    Ok, I found a way to solve this problem. In my silverlight app I opted for using client stack instead of using default http stack.

    WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
    WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);
    

    See also: http://blogs.msdn.com/b/silverlight_sdk/archive/2009/08/12/new-networking-stack-in-silverlight-3.aspx

    0 讨论(0)
  • 2021-01-16 01:46

    What I discovered is that two methods of WebRequest: Create and CreateHttp behave differently when using HTTPS. Always use Create method to instantiate the right request according to a protocol. I had similar situation and that what I've got. For the following code we have Not Found exception when trying to get some content using WebRequest:

    HttpWebRequest request = WebRequest.CreateHttp(uri); 
    

    But the following piece works well:

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    
    0 讨论(0)
提交回复
热议问题