Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

i am doing an mvc4 application

in that i have a api controller called LoginController in my Controller folder.

in the login view, when click on login button, that api controller method will called using

PHP
$.ajax({
                      url: "/api/Login/Authenticate?username=" + username + "&password=" + password,
                      type: "Get",



its working when running vs2008. i published this in my localhost, but when click on login button, this api is not calling.

iis 7.5 detailed error 404.0 not found is showing

How can solve this

Thanks
Kunjammu
Posted
Updated 16-Jun-14 19:54pm
v2
Comments
Kornfeld Eliyahu Peter 17-Jun-14 2:08am    
404 means that the page/resource you asked for not found on the site. Check error details to see what exactly not found.
Also check your publishing process, see if all parts send to the target site!
Kunjammu 17-Jun-14 2:42am    
if i use

url: "/wsm/api/Login/Authenticate?username=" + username + "&password=" + password,

then its working, wsm is the root folder, how can i get the same result without using the name of root folder
Kornfeld Eliyahu Peter 17-Jun-14 2:47am    
URL can be relative or absolute. When relative it's relative to your current page, so sometimes it is not possible to not use absolute (with root)
You may try 'api/Login/Authenticate?' (not opening backslash), but...
Kunjammu 17-Jun-14 3:03am    
not working...is there any idea? :-(
Kornfeld Eliyahu Peter 17-Jun-14 3:05am    
It means that you have to use absolute URL with /wsm/api/Login as root!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900