Server side in MVC not working on deployment
Server side in MVC not working on deployment
Newinthezone
Posts: 22Questions: 0Answers: 0
Hi
I am using server side processing for my datatables in MVC 2.0 . I have a controller which I am using to handle the incoming requests.
When I view the page on my localhost , it works fine and this is a sample of the request header it sends
http://localhost:42417/EmissionByRegion/DataProviderAction?_=1337611318226&sEcho=1&iColumns=40&sColumns=&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&.......[it goes on till 39 columns]
This gets a valid json response and everything works well.
But when I publish this code on a server which is using IIS 7.5 , when there is a postback to the server with the same request parameters:
http://domain.com/EmissionByRegion/DataProviderAction?_=1337612368137&sEcho=1&iColumns=40&sColumns=&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&........
I get a 404 - File or directory not found.
If i just type this : domain.com/EmissionByRegion/DataProviderAction
, it shows that the controller is there and is looking for valid parameters. So it is picking up the controller but when the parameters are being passed, it doesnt work.
Why is the same project not working on the server even though it was working on the local machine and what do I do to get it to work?
Please help .
Thanks
I am using server side processing for my datatables in MVC 2.0 . I have a controller which I am using to handle the incoming requests.
When I view the page on my localhost , it works fine and this is a sample of the request header it sends
http://localhost:42417/EmissionByRegion/DataProviderAction?_=1337611318226&sEcho=1&iColumns=40&sColumns=&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&.......[it goes on till 39 columns]
This gets a valid json response and everything works well.
But when I publish this code on a server which is using IIS 7.5 , when there is a postback to the server with the same request parameters:
http://domain.com/EmissionByRegion/DataProviderAction?_=1337612368137&sEcho=1&iColumns=40&sColumns=&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&........
I get a 404 - File or directory not found.
If i just type this : domain.com/EmissionByRegion/DataProviderAction
, it shows that the controller is there and is looking for valid parameters. So it is picking up the controller but when the parameters are being passed, it doesnt work.
Why is the same project not working on the server even though it was working on the local machine and what do I do to get it to work?
Please help .
Thanks
This discussion has been closed.
Replies
Allan
I got that error fixed as my query string was way to long for the IIS's current configuration. So I increased the limit.
But now I have started getting the 500 Internal server error(as you stated ,a security violation)
it says
[quote]
500 - Internal server error.
The page cannot be displayed because an internal server error has occurred.
Module IsapiFilterModule
Notification AuthenticateRequest
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x8007007a
[/quote]
This is the summary of the error on my hostmachine. It wont display it for anyone else except the host machine. So i thought ill let you know.
What could be the general settings which are required for IIS 7 to cater to datatables plus what about JSONP. I will private message you the link . Please let me know anything else which is required.
It might be an idea to use sServerMethod to change the HTTP method to POST. Then you can set any number of parameters.
> But now I have started getting the 500 Internal server error
There are a million different things that can cause a 500 internal error. You'd need to look at the server's error log to find out what the server thinks the error is.
Allan
I got it to work finally. I changed the methodtype to POST rather than GET. So that reduces the query string to http://domain.com/EFSelect/EmissionByRegion/DataProviderAction.