【问题标题】:jquery ajax post method not work in iis7jquery ajax post方法在iis7中不起作用
【发布时间】:2013-06-09 10:37:27
【问题描述】:

我在 MVC 中的 IIS 7 中的 ajax 调用有问题,我像这样使用 jquery ajax:

   $.ajax({
      url: '@Url.Action("IsLoanNumberValid", "File")',
      type: 'Post',
      cache: false,
      data: {   
            fileCategoryId: ddlFileCategory.value(),
        loanNumber: $("#txtLoanNumber").val(),
       }
   .....} 

我在开发应用程序时没有任何问题,但是当我发布mvc应用程序并在iis post方法中上传时出现问题并且不返回结果,

这是萤火虫设计时的请求

这是应用程序在 iis7 中时的请求

所有的ajax post方法都不能返回结果

Kendo 网格调用的 FilterFiles_Read 方法在 post 方法中也有问题! 网格通过这行代码绑定:.Read(read => read.Action("FilterFiles_Read","File")

这是它的代码

@(Html.Kendo().Grid<CommonData.Domain.File>()
    .Name("Grid")
    .Pageable()
    .EnableCustomBinding(true) 
    .Columns(columns =>
    {
    columns.Bound(e => e.FileCategory.Title);
    columns.Bound(e => e.BankFileNo);
    })
    .DataSource(dataSource => dataSource
    .Ajax()
    .Model(model => model.Id(o => o.Id))
    .Read(read => read.Action("FilterFiles_Read","File").Data("GetValues"))
    .PageSize(10)
        .Total(TempData["Total"] == null ? 0 : (int)TempData["Total"])
    )
)

我必须配置 iis 还是必须更改应用程序?请帮帮我

【问题讨论】:

  • 你在FF以外的浏览器中测试过吗?
  • 是的,所有的都有这个问题“指定的网络名称不再可用”

标签: asp.net-mvc jquery iis-7 http-post kendo-grid


【解决方案1】:

@zeinab kalanaki,你还有问题吗?关注ASP.Net MVC $.Ajax() function not working when hosted in IIS7 的解决方案帮助我修复了我的问题。尝试将您的网址修改为

url: '@Url.Action("IsLoanNumberValid", "File")/',

请注意末尾添加的“/”。对我来说似乎是一个错误。

【讨论】:

  • 苏曼,谢谢你的回复,我错了,网络设置导致这个问题,应用程序正常,非常感谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-31
  • 1970-01-01
  • 2012-06-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多