Intellisense (for jquery) in MVC razor views

Another quick tip. When using master pages or razor layouts you tend to put the script includes in the master but this means your child or view pages do not include any references to the scripts. Therefore you start writing some jquery in your view an Visual Studio does not provide any intellisense. So put the following at the top your view;

@if (false)
{

<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js type=”text/javascript”>

</script>

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s