Search code examples
javascriptasp.netvisual-web-developer-2010

Javascript not found in my ASP.Net Application


I am having a problem in the location of my javascript, the location is right, but when I run it in my visual web developer 2010 express, the location can not be found, I don't know the reason why...

here is the location of my javascript:

<script src="Style/javascript/jquery-1.7.1.js" type="text/javascript"></script>

here is the error:

**Server Error in '/Maitenance' Application.**

**The resource cannot be found.**

**Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.** 

**Requested URL: /Maitenance/Maintenance/Style/javascript/jquery-1.7.1.js**

Solution

  • Use this... It will work

    <script src="<%=Page.ResolveUrl("~")%>Style/javascript/jquery-1.7.1.js" type="text/javascript"</script>