I don't know how to write this title, but I hope the content of this article will help you.
The scenario is as follows:
Jquery is often referenced when we use development programs. However, due to the routing relationship, the address of the final access page is not fixed relative to the JS file.
To reference jquery files in the view, we usually use the following code:
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
There is no problem with running the program, but there is a new problem, that is, when we write js code in the view, there is no jquery smart prompt.
This is really an annoying question.
The following are the solutions I have come up:
Add such code to the view page
1 @if (false)2 {3 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>4 }
Then press Ctrl + Shift + J to update JScript intelliisense
Oh, try again now, and the long-time intelligent prompt is coming out.
Then, use the plug-in code segment function (SNIPPET) in Vs and set a shortcut key to quickly Insert the code.
This method can be used in different pages of.
You can handle smart prompts for other JS files.
Below is my snippet file, JQ. snippet
You can modify it in the past.
<Codesnippet format = "1.1.0" xmlns = "http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
Then, store it in the Directory D: \ My database \ Documents ents \ Visual Studio 2010 \ code snippets \ Visual Web Developer \ My HTML snippets.
(The specific directory depends on your system)