Skip to content

Visual Studio Tips and Tricks

mikepetersonccv edited this page Oct 24, 2012 · 8 revisions

Handy Shortcut to add Usings

When you reference a class that is not in your Usings yet, there is a handy way to add it. Click on the class that it is complaining about, then hover your mouse above the little blue underline that appears (or press +"."), and the editor will suggest to add the Usings. Here is an example:

Add Usings Example - step 1

Add Usings Example - step 2

Handy Trick to get Intellisense to load css in ASCX controls

{
  <%-- Trick intellisense into loading css.  --%>
  <%-- Delete this section before committing to Git to avoid warnings --%>
  <% if ( false )
     {  %>
        <link href="~/CSS/bootstrap.min.css" rel="stylesheet" />
  <% } %>
}

Paste the above into your ascx code and intellisense will help autocomplete CssClass=".. items. When done, make sure to delete the section to help avoid compiler warnings.

Intellisense css

Clone this wiki locally