My JS works when I reference it in the MasterPage, and it works when I reference it in a Partial View (.ascx), but not when I reference from the View (.aspx).
Any ideas why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is the path to the script file correct in your View?
If you inspect HTTP traffic with something like Fiddler or Firebug’s Net tab, do you see your script resources being downloaded to the browser?
You might want to use
UrlHelper.Contentand the relative path to render the script source in the page or perhaps create aHtmlHelperextension method to render out a script tag for you (I think one exists in MVCContrib if you’re using that already).