Moti Mashiah
asked on
asp.net mvc & js
Hi guys,
I am using asp.net mvc 5 and I have one controller that initiate the first page.
something like this:
http://localhost:60219/documentviewer/index.
Now I am calling a service from serviceConfig.json. which look like this:
when I call this json file I am trying to get this link
http://localhost:60219/api/test, but instead I am getting - http://localhost:60219/documentviewer/index/api/test
my question is: how can I get read of the controller and view from the first page and return just -http://localhost:60219/api/test
Thank you.
I am using asp.net mvc 5 and I have one controller that initiate the first page.
something like this:
http://localhost:60219/documentviewer/index.
Now I am calling a service from serviceConfig.json. which look like this:
{
"_comment_": "This file is used if an external application needs to change the values the client application will use to communicate with the service.",
"licenseDirectory": null,
"serviceHost": "http://localhost:60219/",
"servicePath": "",
"serviceApiPath": "api/",
"app3": "",
"app4": "",
"GoogleDriveLoad_ClientID": "",
"GoogleDriveLoad_APIKey": ""
}
when I call this json file I am trying to get this link
http://localhost:60219/api/test, but instead I am getting - http://localhost:60219/documentviewer/index/api/test
my question is: how can I get read of the controller and view from the first page and return just -http://localhost:60219/api/test
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry Misha your answer is not related to my case, but thanks for trying to help.
ASKER
fixed
Sometimes you can pass parameters to the server.
If you want to redirect to another link from your controller, you can use this code:
Open in new window
If you want to redirect to another controller (api), you can use this code, because the default route isOpen in new window
Open in new window