Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, i just started an application in visual studio with webApi template.
I want to use knockoutjs to consume the app but my question is when i am making the ajax call, how will i know the port to use since visual studio gives you random port number.
For example:
$.ajax({
url:http://localhost.com:5068/api/someUrl
Posted
Comments
Richard Deeming 2-Oct-15 10:20am    
Assuming your page is being served from the same site, don't specify the protocol, host name or port number. Just use:
url: "/api/someUrl"
[no name] 2-Oct-15 10:40am    
K. Will try and get back to you. Thanks
[no name] 3-Oct-15 1:56am    
Good day, i got a question that is bothering me now since yesterday. Asp.net mvc scaffolds both controller and view for you but in the case of webApi, it just scaffold the controller with CRUD actions. Please, my question is how do i scaffold a view that points to the corresponding controller action?
Everything i tried returns an error. Please help me on this. I taught it would be easier.

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