.NET Tips – Links on ASP.NET C# WPF , IIS Express, Visual Studio Tips – July 2011

Daily .NET Tips is aiming to sharing useful coding tips and tricks for .NET Developers. This site completely design for sharing Tips and Tricks, useful Code Snippet which anyone use in daily development work and targeted anything related with .NET.  In this post I am quickly listing down all the tips which are posted over the month July 2011.

Continue reading

Few important tips that you should know while using ASP.NET Session

While working with ASP.NET web application you must be familiar with one of most important state management technique “Session”. If you want to do a quick refresh or want to know some thing more, please go ahead and read one of my article “Exploring Session in ASP.NET” published at Code Project. In this post I am going to share some important tips that might be useful.

Continue reading

TOD : Wrapping Code Block and Statements in Visual Studio

In this tips I have explained how you can automatically wrap up code blocks or code statement in Visual Studio. We can use Document formatting to format the whole contents, but that doesn’t wrap single line code block like Properties or not even single line multiple declaration statement.  Let’s consider an example, you are creating a Properties using code snippet and by default it will came up like


But, you want you code to be look like as below


How ? Read Complete Tips

100 Useful .NET Tips & Tricks

Daily .NET Tips is aiming to sharing useful coding tips and tricks for .NET Developers. This site completely design for sharing Tips and Tricks, useful Code Snippet which anyone use in daily development work and targeted anything related with .NET.  I started with this new site few months back and with in short time period we have total 100 Tips which mainly focused on the practical oriented problem. You can find tips related with C#, ASP.NET, Silverlight, WPF, WCF, JQuery, WP7 etc.

To know more ……

Light bulbVisit  http://dailydotnettips.com

Light bulbSubscribe Tips to your mail box : http://bit.ly/hFAhop

Light bulbFor Quick Update Follow : @dailydotnettips 

Thanks to all the contributors Abhishek Sur, Prayan Rana, Jebarson Jebamony, Atul Verma,Shravan Kumar  who spends their time and shared tips.

Looking forward more contribution from all of you.

Freezing If you want to contribute your tips at  http://dailydotnettips.com , please contact with me via Contact Page.

Thanks !


Generic Way to Bind Enum With Different ASP.NET List Controls

In this post I am going to explain how we can bind a Enum with ASP.NET List Controls. These comprise of four different types of control, CheckBoxList, DropDownList, ListBox and RadioButtonList. This is one of the common requirements during development to bind a Enum with List Control and challenge is when we need to bind the both text and value.
Let’s consider we have the blow Enum. Now I am going to bind it with all the above mentioned type List Controls.

Well, One of the easiest way that we can implement is by Enum.GetNames(Type enumType)which retrieves the name list of enumberation  and Enum.GetValues(Type enumType), which returns the list of values for each names .
Continue reading

14 Useful .NET Debugging Tips & Tricks in Visual Studio


List of few useful debugging tips and tricks

1. How to use Runtime Objects in Watch Window during debugging in Visual Studio ?

2. How to use out of scope object with in Conditional Breakpoint ? 

3. Use Conditional Breakpoints with Method Calling in Visual Studio

4. Calling Methods From Watch Window

5. Changing Variables Display Format in Watch Window

6. Get Object Generation using Watch Window

7. Save IntelliTrace Log from IntelliTrace Window

8. Last Session Debugging Value using Data Tips

9. Few Tips on Customizing Debugging Window View in Visual Studio

10. Using DebuggerStepThrough attributes to stepped over code during debugging

11. Hide Methods from debugger Using DebuggerHidden attribute

12. Use “Obsolete” attributes to indicate Obsolete Methods

13. How to suppress compiler warning using #pragma warning directives in Visual Studio ?

14. Customize the Debugging Windows : Change Debugging Window View as per your requirements

To know more Tips and Tricks visit http://dailydotnettips.com and Follow @DailyDotNetTips

Thanks !


ASP.NET Custom Repeater Control with EmptyTemplate, ShowHeaderWhenEmpty,ShowFooterWhenEmpty,ShowCount Properties

If you have worked with ASP.NET GridView Control you must be aware of GridView.EmptyDataTemplate Property  which Gets or sets the user-defined content for the empty data row when a GriimagedView control  data source has no records. Similarly ShowHeaderWhenEmpty property allows you to show or hide the Header row when there is no records. These are the really good and very frequent required properties. Now, if you are working with the Repeater Control, it doesn’t have any direct features which enables you to set user define content when data source is empty. In this blog post I will discuss how we can create a custom ASP.NET Repeater control with support of EmptyTemplate along with few more important features.

Continue reading

How to track an object which is Out of Scope while Debugging ?

In Mastering in Visual Studio 2010 Debugging article I have discussed about the basic of Object ID creation while debugging. I received some request from some readers to explain the use of “Make Object ID” in details. In this blog post I am going explain how we can track an Object which is already out of scope using by creating a Object ID while debugging.

By using “Make Object ID” option we are informing Visual Studio Debugger to keep track of that object no matter it’s within scope or out of scope for the current context.  We can create “Object ID” either from Locals, Autos or from Watch Windows. Object ID is a integer number followed by a pound (#) sign. When we create Object ID for an particular object, Visual Studio Debugger ( CLR Debugging Services )  use an integer value to uniquely identify the object. This “Object ID” allows you to get the object details even if it is out of scope.

Continue reading

ViewState Control in ASP.NET 4.0

View State is one of the most important and useful client side state management mechanisms. It can store the page value at the time of post back (Sending and Receiving information from Server) of your page. ASP.NET pages provide the View State property as a built-in structure for automatically storing values between multiple requests for the same page.

we generally used “EnableViewState” Properties for both Page Level and Server Control Level to maintain the view state. Till ASP.NET 3.5 Version, Page Level view state control treat as highest priorities. Which means If we set EnableViewState= “False” in page level that will automatically derived by all the server side control. In that case if we set “EnableViewState=”True”” for any server side control will treat as false, as we have defined them “False” in Page Level.Here is one complete article on ASP.NET 2.0/3.5 View State , which may helpful for you

Now, let’s have a look into the changes in ViewState Control in ASP.NET 4.0. There is a massive change in View State Control in ASP.NET 4.0 which is very much helpful for developer also. Asp.net 4.0 added a new property to Page object and server controls called ViewStateMode. Continue reading