0

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.?

asked Oct 23, 2012 at 10:14

1 Answer 1

2

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.

answered Oct 23, 2012 at 10:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.