Hi
I have a web page where i need to use some javascript.
If i write all the javascripts and jQuery javascripts in the aspx page it works perfect.
But when i write all the javascripts in separate file called scripts.js and include scripts.js in the aspx page it doesn't work.
Here is how i have included the scripts file in my aspx page or let's say master page:

<script src="../../Scripts/scripts.js" type="text/javascript"></script>

I am using asp.net mvc.

I have been using asp.net and i used to do the same thing in asp.net and it used to work fine but it doesn't work in asp.net mvc. I have been noticing this for quite some time now.

Any advice
Thanks

Recommended Answers

All 3 Replies

Your syntax indicates that the scripts folder is two levels up from your aspx page. Is that the actual case?

Meaning, you'd have a directory structure like this

/Scripts/scripts.js
/somedirectory/somedirectory/yourpage.aspx

ya
i already checked the directory structure it's ok.

i think there is something to do with asp.net mvc

hii,
u can try that,
copy script.js in app_code directory...
then try it....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.