我的Silverlight 4应用程序托管在ASP.NET MVC 2 Web应用程序中。当我使用Internet Explorer 8浏览时,它工作正常。但Google Chrome(版本5)无法找到ASP.NET控制器。具体而言,以下ASP.NET控制器可以与Chrome和IE一起使用。Google Chrome客户端的ASP.NET MVC路由问题
//[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
public ContentResult TestMe()
{
ContentResult result = new ContentResult();
XElement response = new XElement("SvrResponse",
new XElement("Data", "my data"));
result.Content = response.ToString();
return result;
}
如果我取消[OutputCache]属性的注释,那么它可以在IE中使用,但不能在Chrome中使用。此外,我使用自定义的模型与控制器结合,因此,如果我写了以下内容:
public ContentResult TestMe(UserContext userContext)
{
...
}
它也可以与IE浏览器,但同样无法与Chrome这给了我错误说资源没有被发现。当然,我将IIS 6配置为通过aspnet_isapi.dll处理所有请求,并且我在Application_Start()方法内的Web应用程序的Global.asax中注册了自定义模型联编程序。 有人可以解释我可能是什么原因?谢谢。
谢谢codeka。提琴手岩石。我发现了这个问题;谷歌浏览器在请求头(编码URL)中放入“Content-Type:application/x-www-form-urlencoded”,但IE不这样做。因此,下一个问题是如何在Chrome中禁用网址编码。 – synergetic 2010-06-15 08:22:55