Visual Studio 2010 new Intellisense enhancements
In this post I am going to demonstrate through (screenshots mostly) some very handy, useful new features regarding Intellisense that ship with VS 2010. Through these features we can be more productive.
Intellisense is very useful and has been an integral part of VS since its first release back in 2001. Microsoft's main aim is to to have "Intellisense everywhere"
1) Create with VS 2010 an ASP.NET website.Save your website in your local file system.
2) If you want to insert an update panel for example in the Default.aspx page, you can simply type left angle <up . When you do that you will see something similar to the picture below.....
3) Now if you press Tab twice you will see something similar to the picture below. We have the whole code for an update panel with a few keystrokes.
Please note that this new enahanced Intellisense works equally well for Html Controls. If I type for example <img and hit the TAB twice, I will have something like <img src="#" alt="Alternate Text" /> completed for me.
4) We have great Intellisense support for Javascript as well.If I type script and hit TAB once, I get
<script type="text/javascript"> </script>
Then if inside my javacript code area type function and hit TAB once, I will get something like this.
function myfunction() {
}
Have a look at the picture below
Please note that we do have JS Intellisense inside the JS function.
5) Switch to the Default.aspx Designer View, drag and drop a repeater control in the .aspx page.
6) Go to the Default.aspx.cs file and in the Page_Load event type Repeater1.temp
Now of course we have Intellisense as we used to have but we also have more options.
See the picture below.
We have TemplateControl as an option but we also have AlternatingItem Template and Footer Template.
So Intellisense is more "clever" and shows us all the options with the "temp" argument in them... not just the properties-methods that start with "temp"
We have more intelligent Intellisense for Pascal Casing.
For more information about Pascal casing click here .
if you type Repeater1.DB you will get Repeater1.DataBind
but if you type Repeater1.db you get nothing. That is because new Intellisense "honours" the Pascal casing syntax.
Have a look at the picture below