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

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.