문제

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

도움이 되었습니까?

해결책

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")',
    ...
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top