Isuru
Isuru

Reputation: 970

JQuery Datatable not working in IIS

I have configured jQuery Datatables server side processing with my asp.net application. It is working on local host perfectly. But not working after hosting in IIS. By looking at the Firebug it seems that error is due to the way i have set the path(to GenericHandler File). Im not sure.

Project Structure

eKnittingSimple(root)->GenericHandlers(folder)->StylesDataHandler.ashx(GenericHandler)

The way i have set the path in aspx

sAjaxSource: '/GenericHandlers/StylesDataHandler.ashx'

The error i am getting in firebug after hosting in IIS

"NetworkError: 404 Not Found - http://192.168.194.182/GenericHandlers/StylesDataHandler.ashx?sEcho=1&iColumns=7&sColumns=%2C%2C%2C%2C%2C%2C&iDisplayStart=0&iDisplayLength=5&mDataProp_0=StyleId&sSearch_0=&bRegex_0=false&bSearchable_0=true&bSortable_0=true&mDataProp_1=StyleCode&sSearch_1=&bRegex_1=false&bSearchable_1=true&bSortable_1=true&mDataProp_2=StyleName&sSearch_2=&bRegex_2=false&bSearchable_2=true&bSortable_2=true&mDataProp_3=GarmentTypeName&sSearch_3=&bRegex_3=false&bSearchable_3=true&bSortable_3=true&mDataProp_4=BuyerName&sSearch_4=&bRegex_4=false&bSearchable_4=true&bSortable_4=true&mDataProp_5=SeasonName&sSearch_5=&bRegex_5=false&bSearchable_5=true&bSortable_5=true&mDataProp_6=&sSearch_6=&bRegex_6=false&bSearchable_6=true&bSortable_6=true&sSearch=&bRegex=false&iSortCol_0=0&sSortDir_0=asc&iSortingCols=1&_=1463633008979"

Upvotes: 0

Views: 859

Answers (1)

Felice Pollano
Felice Pollano

Reputation: 33252

This is probably due to the fact address is root based and in IIS site is hosted in a "/" subfolder. Try to modify the address as below:

sAjaxSource: 'GenericHandlers/StylesDataHandler.ashx'

i.e.: Remove the leading "/" so the call will be relative to your page location.

Upvotes: 1

Related Questions