Friday, October 26, 2012

.Net Tips


.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 Hold “Alt” 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
1.HeaderFreez
2{
3position:relative ;
4top:expression(this.offsetParent.scrollTop);
5z-index10;
6}
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

Note:Contents are copied from abhijhet.net for the benefit of developer.

No comments:

Post a Comment