Asp.net JSON调用+。net在内置web服务器上以调试模式工作,但不直接转到虚拟目录

Asp.net JSON调用+。net在内置web服务器上以调试模式工作,但不直接转到虚拟目录,asp.net,javascript,jquery,json,Asp.net,Javascript,Jquery,Json,我有以下javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: { email: strEmail, message: strMessage }, success: function(result) { //alert('here'); alert(result.message); }, error: function(error

我有以下javascript:

$.ajax({
  type: "POST",
  dataType: "json",
  url: "/Home/Submit",
  data: {
    email: strEmail,
    message: strMessage
  },
  success: function(result) {
    //alert('here');
    alert(result.message);
  },
  error: function(error) {
    alert(error);
  }
});
这将调用此函数:

public JsonResult Submit(string Email, string Message) {
  return Json(new {
    message = "yep"
  });
}
这在内置Web服务器的调试模式下运行良好

但是,如果我直接转到虚拟目录,它不会,并且会命中错误位。我加入了这个过程,而背后的代码从未被击中

我正在使用Vista

此外,如何在表示警报(错误)的位中获取错误描述

谢谢


Alex

您的虚拟目录是否位于web服务器的根目录?您提供的路径是根目录,如果您的虚拟目录不在根目录下,该路径将不起作用。

您的虚拟服务器是否在Windows 2003和IIS 6.0上运行?或者是Windows 2008和IIS 7.0。另外,您正在谈论的内置服务器是Visual Studio服务器还是Windows Vista中的IIS 7.0?这一切都很重要。使用IIS 6.0,您需要使用通配符通过.NET运行所有请求

出于兴趣,为什么需要在iis6中通过通配符运行所有请求?