Starting jQuery and Get the downloads and patches(for Visual Studio.NET 2008)




- June 11, 2020

Rest of the Story:

1.) Download install VS.NET 2008 SP1 patch Visual Studio 2008 SP1 has the following patch to allow IntelliSense with jQuery found here.  Note: this is a patch that is applied after .NET 3.5 SP1 and Visual Studio 2008 SP1.  Information about this patch can be found here. I did find that the vsdoc.js version must match the version of jquery in order for the intellisense to function correctly.  If the versions mismatch intellisense will not work.

2.) Download jQuery documentation library

3.) Download jQuery 

4.) Copy both 2 and 3 to your solution Scripts folder

5.) In your aspx reference the jquery file

<script src="Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>    or    <asp:ScriptManager runat="server" ID="scriptmanager1">     
    <Scripts>      
        <asp:ScriptReference Path="~/Scripts/jquery-1.2.6.min" />      
    </Scripts>      
</asp:ScriptManager> 

Some Quick Tips

  • If you are using a master page the script reference only needs to exist in the master page
  • javascript intellisense will not work in user controls by default as the user control doesn’t have a reference to the js file.  A work around (use the following at the top of the user control).  At runtime ASP.NET will not render this tag however Visual Studio will evaluate the script and provide intellisense

<% if (false) { %>

<% } %>

  • a recommended method of including js files is to create one js file which entail will include references to any number of specific js files, then on your web page include a reference to this one single js file
  • a good approach is to remove the version number from the jquery files to allow easier updates to these files in the future
    Path(s) for Script References * File-Relative Paths i.e. ../../file.js This type of path is relative to the currently loaded file.  Support - ASP.NET Web forms / MVC

  • App-Relative Paths i.e. ~/folder/file.js  Is calculated from the base of your application.  ASP.NET Web forms supports this type of path however the path must be within a scriptreference tag or select asp.net controls which have runat=”server”

  • Site-Relative Paths i.e. /folder/file.js  Is calculated from the base of your site.  Supported by ASP.NET Web forms / MVC however is not supported by Visual Studio

  • Absolute Paths i.e. http://site/folder/file.js  Supported by ASP.NET Web forms / MVC and Visual Studio If using Visual Studio(ASP.NET Web forms) recommended to use App-Relative paths ~/folder/file.js. 

If using MVC use file-relative paths.