Quantcast
Channel: Andrew Gunn's Blog
Browsing latest articles
Browse All 26 View Live

HTML 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 Article



How 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 Article

How do I add a HTTP module in ASP.NET?

<?xml version="1.0"?><configuration><system.web><httpModules><add name="ModuleName" type="ClassName, AssembleyName"...

View Article

ASP.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 Article

JavaScript - 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 Article


The 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 Article

The 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 Article

iPhone 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 Article


SQL 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 Article


Equals, 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 Article

Xbox 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 Article

jQuery $(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 Article

EventType 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 Article


jQuery 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 Article

Custom 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 Article


How 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 Article

0x80048820

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 Article


CSS "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 Article

How 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

To serialize, or not to serialize - that is the question

When serializing objects, you sometimes want to exclude properties that don't meet a certain criteria. This validation could be a simple check for default/null values or a more complicated...

View Article

ASP.NET MVC - UserControls and IPrincipal

This is my first post on ASP.NET MVC so I'm gonna keep it short and sweet (I'm sure they'll be plenty more to come :-D).On a MVC View Page, you can access the user that has been previously...

View Article


SQL - Dynamic Order By clause

Have you ever wanted a stored procedure to order it's results dynamically? The ORDER BY clause is the place to start but normally relates to a series of columns that's hard-coded. If you want this...

View Article


Image may be NSFW.
Clik here to view.

Agile Development

View Article

Catch-all redirect in Apache

Assume you have a website running on an Apache server and the URL is http://mydomain.com/. What if you want to dominate the UK market too!? You'd probably buy mydomain.co.uk and point it to the same...

View Article

Image may be NSFW.
Clik here to view.

Article 0

View Article

Browsing latest articles
Browse All 26 View Live




Latest Images