0

I am trying to deploy my application on IIS, but it seems it won't work.

When I run the application on the localhost it gives me no problem, but deploying it on the IIS webserver it encounters some routing problem. I checked it with firebug and I see the post request sent do not find any target.

The request sent:

http://xxxxx.com/Customer/CustomerListByFiter?jtStartIndex=0&jtPageSize=10

-> Not works (page not found?)

The local request sent on my localhost:

..../Customer/CustomerListByFiter?jtStartIndex=0&jtPageSize=10 -> Works

The Customer is my Controller class and CustomerListByfilter is the method with its parameters...

What I am doing wrong?

UPDATE:

I have build a sample application, this is the code which deploying to the webserver IIS generates an error (running it via Visual studio it works fine):

View:

   //Prepare jtable plugin
    $('#CustomerTable').jtable({
        title: 'xxx xxx',
        messages: germanMessages, //Localize table
        selecting: true, //Enable selecting
        multiselect: false, //Allow multiple selecting
        selectingCheckboxes: true, //Show checkboxes on first column
        paging: true,
        columnResizable: true, //Actually, no need to set true since it's default
        columnSelectable: true, //Actually, no need to set true since it's default
        saveUserPreferences: true, //Actually, no need to set true since it's default
        //selectOnRowClick: false, //Enable this to only select using checkboxes
        defaultSorting: 'CUST_LASTNAME ASC',
        actions: {
            listAction: '/Home/CustomerListByFiter'
        },

Controller:

    [HttpPost]
    public JsonResult CustomerListByFiter(string name = "", string lastName = "", int   
    cityId = 0, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
    {
        List<customers> customers = null;
        try
        {
            if (name == "" && lastName == "")
                customers = CustomerList();
            else
            {
                customers = db.customers.Where(c => c.CUST_NAME == name || 
                c.CUST_LASTNAME == lastName).ToList();
            }

            string json = new JavaScriptSerializer().Serialize(Json(new { Result = 
            "OK", Records = customers }, JsonRequestBehavior.AllowGet));
            return Json(new { Result = "OK", Records = customers, TotalRecordCount = customers.Count() }, JsonRequestBehavior.AllowGet);
        }
        catch (Exception ex)
        {
            return Json(new { Result = "ERROR", Message = ex.Message });
        }
    }

I am pretty sure the problem is generated by the following call: listAction: '/Home/CustomerListByFiter' -> locally it works, remotely not.

System: IIS 7.5 Windows Server 2008 R2 Deployed as Application

L. F.
  • 19,445
  • 8
  • 48
  • 82
pamaxeed
  • 23
  • 1
  • 6

0 Answers0