ASP.NET MVC2, getJSON, Jquery Windows 7 64bit IIS

2019-08-23 13:53发布

问题:

I have started learning MVC2.

I developed a simple customer search screen with Jquery and Json calls. In debug mode everything works.

When i deployed to my local iis server and after configuring the app pools i got the app to run.

When i do the search nothing happens, it like the json call is not working and i dont get any errors either.

I have tried a lot of things - nothing seems to work.

e.g : $.getJSON("<% = ResolveUrl("~/ClientSelect/Search") %>"...

Has anyone else had this problem?

What works locally breaks once its deployed to a virtual directory - i am i doing something wrong here?

thanks

Updated!!

*****Solved: it was the 'ASP.NET v4.0' app pool using 'ApplicationPoolIdentity'. This identity does not have access to my SQL Server. Solved by setting this to LocalSystem.*****

回答1:

Ensure that your generated URLs are matching what you think they should match. I have ran into this issue before with JS and MVC when moving a site around. Do a view source on your web page to get the generated URL.