简体   繁体   中英

jquery ajax post method not work in iis7

I have problem with ajax call in IIS 7 in MVC , i use jquery ajax like this:

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

i don't have any problem when i develop application but when i publish mvc application and upload in iis post method have problem and do not return result ,

this is requests in firebug design time 这是萤火虫设计时的要求

this is request when application is in iis7

在此处输入图片说明

all of ajax post method can not return result

also FilterFiles_Read method that Called by Kendo grid have problem in post method! grid binds by this line of code : .Read(read => read.Action("FilterFiles_Read","File")

this is its code

@(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"])
    )
)

Do i must configure iis or must change applicaion? please help me

@zeinab kalanaki, Do you still have problem? The solution in following ASP.Net MVC $.Ajax() function not working when hosted in IIS7 helped me fixed mine. Try amending your url to

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

Notice the added '/' at the end. seems like a bug to me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM