Reputation: 1903
I have call controller action through javascript using window.location
window.location = "/SomeController/SomeAction/";
it's working fine but when i will develop it in on sub-domain it not constructing URL properly
My URL Is
http://testgecianet/pms/
when i call the action it construct URL like
http://testgecianet/SomeController/SomeAction
instead of
http://testgecianet/pms/SomeController/SomeAction
how i can construct correct path when application deploy on SubDomain.?
Upvotes: 0
Views: 1762
Reputation: 47784
did you try using @Url.Action
?
For example your code of
window.location = "/SomeController/SomeAction/";
could be written like
window.location = "@Url.Action("SomeAction","SomeController")";
This could solve the problem, I hope.
Upvotes: 2