0

I am having problems referencing scripts that should be included in my view, when I access the page using a different route my scripts fail.

The idea is that two routes actually point to the same action:

http://localhost/PaydayWebsite/registration

http://localhost/PaydayWebsite/organizations/p001/departments/vest/employees/chn/registration

where the second just include more params for my action. I have tried using

ResolveUrl, Url.Content and mvccontribs Html.ScriptInclude but neither seem to work. Any ideas?

1 Answer 1

2

You should be able to use Url.Content, but you'll need to make your path relative to the root of the application rather than the current path.

Use

 Url.Content( "~/Content/Scripts/jquery-1.3.2.min.js" )

rather than

 Url.Content( "../../Content/Scripts/jquery-1.3.2.min.js" )
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.