Learn one new .NET trick every day
Web GTD system
from the creators of DotNetTipOfTheDay.org
.NET Tip of The Day Archive
How to respond with code 404 (Not Found) in ASP.NET.
Code snippets for some common operations with exceptions.
Send an e-mail any time an unhandled exception occurs.
Turn off Session State if you're not using it.
How to debug Windows Service startup.
How to change HTML markup produced by ASP.NET controls.
Label to a form input field.
Add Windows Explorer to your Visual Studio tools menu.
Correct event invocation.
How to view code that is covered by the IntelliSense pop-up.
When returning DataReader from a function, specify CommandBehavior.CloseConnection.
Use explicit casting instead of DataBinder.Eval.
Consider using weak references for your custom caching solutions.
Automatically insert attribute value quotes.
Correct using of ASP.NET Cache.
Treat .NET Threads as a shared resource.
How to create fully qualified URLs.
COALESCE function instead of long CASE WHEN ... ELSE (T-SQL).
Cut a line into memory.
How to check email works without using SMTP.
A simple method to validate an integer, double, date, and currency values entered into a textbox on ASP.NET page.
What is the difference between UriBuilder.ToString and UriBuilder.Uri.ToString.
Visual Studio Bookmarks.
Generating compiler warnings for calls to an obsolete methods.
Big solutions can be organized using Solution Folders.
How to change the default view for Web pages and WinForms in Visual Studio.
Use DebuggerBrowsable attribute to clean up class view in a debugger.
What is the difference between URL and URI?.
Don't generate unnecessary WinForm members for Label controls.
Simplify the usability of your generic methods with type parameter inference.
Two approaches to update database row if exists, insert if not.
Improve your code readability: make more sense to conditions.
Speed up inserting records into database with SqlBulkCopy class.
Create elegant code with Action delegate and List.ForEach method.
Disable Submit button after it was clicked.
Setting focus during a validation error.
Which is better: Control or WebControl?.
Handling errors at the method level.
How to call a surrogate for Dispose() on StringBuilder objects.
How to determine whether a property or a method is more appropriate for your needs.
Verbatim string literals.
Speed up Visual Studio 2005.
How to resolve relative url's without ResolveUrl.
How to maintain the position of the scrollbar on postbacks (across the entire site).
Debugger variable $exception.
Explicitly suppress and restore compiler warnings using the #pragma warning directive.
Validate integer value before casting it to an Enum type.
Return read-only collection if you want to control its modification.
Create elegant code with generic collections and Predicate delegate.
Speed testing in .NET - System.Diagnostics.Stopwatch.
Use Tab twice to get the code snippets that are available within code editor.
?? operator (C#).
Optimize the launch of the Visual Studio 2005.
Conditional breakpoints in Visual Studio.
Use Path.GetRandomFileName() or Path.GetTempFileName() when working with temp files.
Consider using System.IO.Path.Combine() instead of string concatenation.
Always check Page.IsValid in your button's EventHandler.
Use DebuggerStepThrough attribute to save time when debugging.
Speed up string comparison.
Quickly move to matching brace in Visual Studio.
Linking a file in Visual Studio.NET.
Don’t clear the stack trace when re-throwing an exception.
Exceptions cause performance to suffer significantly.
Quickly locate where the exceptions are thrown.
Visual Studio Full Screen Mode.
Incremental search in Visual Studio.
Auto-complete the word in Visual Studio 2005.
Always set the "applicationName" property when configuring Membership and other Providers.
Don't forget to <clear/> when adding providers.
How to perform DateTime calculations in a right way.
How to maintain the position of the scrollbar on postbacks.
Strongly-typed access to previous page during cross-page postback.
How to get virtual path of web application.
Strongly-typed access to Master Pages controls.
Conditional compilation with ConditionalAttribute.
How to locate control nested inside of another control.
How to set the default focus to a control when the page loads.
Set the default button that is triggered when the user hits the Enter key.
How to change the default browser used in VS 2005.
Use server-side comments to temporary disable part of ASP.NET page.
Use parameters instead of string concatenation for forming SQL queries.
Use "App_Offline.htm" feature while updating a web site.
Use on-demand web-site compilation option to improve build times.
Keep the number of files in your /app_code directory small.
Use DebuggerDisplay attribute for a better debugger experience.
Do not include the "@" character when supplying stored procedure parameter names to a SQL Server database.
.NET Tip of The Day
Subscribe to receive one tip from the .NET Tips and Tricks Community per day.
Previous Tips of The Day
The best of the .NET Tips & Tricks Community.
.NET Tips & Tricks Community
Every .NET practitioner has a trick up in their sleeve. This is the place to share it with other .NET people.
Submit a Tip
Discovered a new trick? Share it with others.
Manage tips you authored.
©2007-2008 .NET Tip of The Day.org