How do I include browser specific CSS files?
Internet Explorer 6 and 7 respectively:<!--[if lte IE 6]><link href="/css/IE6.css" rel="stylesheet" type="text/css" /><![endif]--><!--[if lte IE 7]><link href="/css/IE7.css"...
View ArticleHTML labels
HTML labels can be placed next to form controls as an indication of what they represent so the user has an idea of their expecated value(s). They can also be linked to an individual control using the...
View ArticleHow do I create controls at runtime in ASP.NET
If you want to create controls at runtime and render them, the LoadControl method should be used instead of doing a normal object declaration. This is the only way that child controls (within the...
View ArticleHow do I add a HTTP module in ASP.NET?
<?xml version="1.0"?><configuration><system.web><httpModules><add name="ModuleName" type="ClassName, AssembleyName"...
View ArticleASP.NET LinkButton without JavaScript
If you use ASP.NET LinkButton controls, the client browser must have JavaScript enabled. If JavsScript is disabled, clicking on the link won't cause a postback. To avoid this scenario, use standard...
View ArticleJavaScript - Anchor popups
If JavaScript is disabled, the user will be redirected to whatever is in the href attribute in a new frame. If JavaScript is enabled, a new window will open with the same content but the parent window...
View ArticleThe C# ?? (null coalescing) operator
The ?? operator checks whether the value on the left side of the expression is null, and if so it returns an alternate value on the right side of the expression. If the value on the left side of the...
View ArticleThe hyperlink trailing slash
When creating hyperlinks to a folder resource, always trail with a forward a slash.http://andrewgunn.blogspot.com/test (slower)Vshttp://andrewgunn.blogspot.com/test/ (faster)Any reqeusts for the URL...
View ArticleiPhone ringtones
The following guide is for creating custom iPhone ringtones using iTunes. Some instructions might be specfic to Windows but the same principles apply to other operating systems.Create an AAC format...
View ArticleSQL Server compatability level
When you upgrade to SQL Server 2005, you may find that some SQL statements are no longer valid and produce errors. A typical example is when you have 2 tables under different databases with the same...
View ArticleEquals, Equals Equals or Equals Equals Equals?
In JavaScript, you often see conditional statements with 3 equals signs (===). I always thought it was a typo but it turns out to have a significant advantage over the traditional 2 equals signs (==)....
View ArticleXbox Live Avatars
The Xbox 360 dashboard was given a facelift back in November 2008 and one of the new features is Avatars - like a "Mii", only better! I've customised my avatar which you can see right here on my blog....
View ArticlejQuery $(document).ready()
We all know that anything inside the $(document).ready() function will execute in between loading the DOM and content. Here is a syntax alternative for those who want to save a few...
View ArticleEventType clr20r3
I was recently on call when I got alerted to a scheduled task that failed to run - the following error was added to the Event Viewer: EventType clr20r3, P1 MyApp.exe, P2 1.0.0.21357, P3 4935215a, P4...
View ArticlejQuery watermark plugin
Here is a jQuery plugin for adding a watermark effect to elements (e.g. text box):(function($) { // The element that has focus (or null when nothing has focus). var inputFocus = null; // This keeps...
View ArticleCustom controls in ASP.NET MVC
Finally, my article on custom controls in ASP.NET MVC has been published on CodeProject so check it out:http://www.codeproject.com/KB/custom-controls/MVCCustomControls.aspx
View ArticleHow do I clean up my log files?
Create a scheduled task that will execute the following command:C:\WINDOWS\system32\forfiles.exe /p C:\logs /s /m *.log /d -7 /c "CMD /C del @FILE"This example recursively deletes "*.log" files older...
View Article0x80048820
I recently kept getting an error after trying to sign into Windows Live Messenger or sync Windows Live Mail. My laptop had been unplugged at the mains for over a week and the date/time settings were...
View ArticleCSS "or" separator
<div style="background-color: white; margin-left: -10px; margin-top: 40px; padding: 5px; position: absolute;">or</div><div style="border-left: solid 1px #999; height: 8em; margin:auto;...
View ArticleHow do I create the ASPState database?
After installing the Microsoft .NET framework 2.0, launch a command window and run:aspnet_regsql.exe -ssadd -sstype p -S {Server} -U {Username} -P {Password}
View Article
More Pages to Explore .....