Thanks for your continuous encouragement of the tips I have shared on .NET.  To take the series of tips in a next steps, .NET Tips now moved to a new site . Please Visit : http://dailydotnettips.com For Daily Tips on .NET. 

.NET Tips and Tricks
.NET Tips and Tricks

 

Here is the list of old tips. Please Visit : http://dailydotnettips.com For Daily Tips on .NET. for get daily updates on .NET Tips !

How to select Block of Code in Visual Studio?

You can select line by line code very easily using mouse or keyboard. But if you want to copy some code block where you don’t to select all part of line or something like that, here is a Quick TIP For you. Press and HoldAlt” Key, and select the code region.

With Alt Default

                  Using Press ALT Key                               Default Selection

How to Place your reusable code into Toolbox in Visual Studio?

This is very important and small tips for all VS users. Sometimes we need a small piece of code in many places of our application or in some different application. What we do? We just copy the code from one page and paste it to the destination page.

Visual Studio having a great feature, that you can place your code snippet inside the toolbox. For that you need to just select the code snippet and drag the selected snippet on to the general Tab.CodeSnippet

You can rename the selected snippet, by just right clicking on snippet and click on Rename.

RenameCodeSnippet

Now, you can use it anywhere in your application or in any VS Application by just drag and drop of the selected snippet.

Hope this will help you in future from rewrite of code.

How to Freeze GridView Header While Scrolling ?
This is very common problem in Web development that we need to freeze the GridView header at the time of scrolling, Here is one simple tips:
Step 1 : Create a CSS class as following

.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}

Step 2 Set Gridview’s HeaderStyle CssClass as follows
CssClass="HeaderFreez"
That’s all. Some times we need also maintain the scroll positions while selecting any data from GridView, and quite difficult to maintain the position while we are using AJAX, I have written a complete article on that, hope this will help Maintain GridView Scroll Position inside updatepanel

Cheers!!
Abhijit