Form Authentication (using jquery.ajax) failed after setting up IIS 7

572 views Asked by At

i am creating a website on MVC3. I was using the default VS2010 web server and my login page (using jquery.ajax) was working perfectly fine.

because of some specifications, i had to create an application in my localhost and start using my localhost web server.

thing is that for unknown reasons, my ajax call doesn't even make it to my Action in my controller. It errors as soon as i click Login. i look at errorThrown property and is 'undefined'. I haven't modified at all my login code for at least 3 months, so, that's out of the question. if i use development server it works just fine.

I read a couple of articles here , this one looked like my problem but the solution offered there is not working for me.

thanks

1

There are 1 answers

0
Darin Dimitrov On BEST ANSWER

I guess you hardcoded the url in your AJAX request:

$.ajax({
    url: '/somecontroller/someaction',
    ...
});

instead of using an url helper to generate it:

$.ajax({
    url: '@Url.Action("someaction", "somecontroller")',
    ...
});