ASP.NET
Override Default SPAN Tag for Composite Controls
When creating a composite control in ASP.NET, by default, the main container tag that holds all of your controls and HTML is output as a SPAN tag. One of the issues with this default behaviour is that SPAN elements (at least according to the standard) are "inline" elements. As opposed to something like "DIV" elements which are "block" level elements, SPAN tags are inline and should only contain other inline elements. So if you are adding any block level elements to your composite control, in order to be aligned with standar
CSS Shorthands and Input Styling
The following is a list of useful shorthands for specifying typically large CSS properties in a small and succinct one line definition. This not only keeps your CSS files clean and easy to read, but more importantly, it significantly reduces the size of your CSS files.
Checking if Browser Supports Cookies (ASP.NET)
Most of the time, when you check forums about checking if a user's browser has cookies enabled, you will see posts that say you should use the following:
Fixing Relative Paths in C# ASP.NET When Using Url Rewriting
UPDATE: This method is generally used in situations where you have relative paths in your project so that links (image, href, css, etc) work on your development environment (where the VS web server inserts a virtual path), as well as your production environment that may or may not have that same virtual path. The simpler way to handle this situation is to change the virtual path in your development environment. To do this, click on your web site project and look in the properties dialog. You should see a Virtual Path setting.
Ajax - Exception has been thrown by the target of an invocation
If you're working with Ajax in .NET, you'll probably see an exception like this at some point:
Exception has been thrown by the target of an invocation
Not very helpful. What you need to do is tell the ScriptManager to catch post back errors and re-throw the InnerException. Change your ScriptManager to look like this:
<asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError">
</asp:ScriptManager>

Recent comments
4 hours 3 min ago
2 days 11 hours ago
6 days 2 hours ago
1 week 3 days ago
2 weeks 18 hours ago
2 weeks 2 days ago
3 weeks 7 hours ago
3 weeks 1 day ago
3 weeks 1 day ago
3 weeks 6 days ago