Sunday, 1 February 2009

Microsoft Press Kit - Library not registered

Have you or are you studying for a Microsoft certification? If you and have installed the Press Kit exams on to a Vista PC, when you run the test software you receive the error:

Run-Time Error -2147319779 (8002801d)
Automation Error
Library not registered

Find it frustrating? To solve this issue, you need to register the VideoSoft component library Vsocx6.
You can do this from the command line with the prompt:

regsvr32 c:\Windows\System32\Vsocx6.ocx

Friday, 30 January 2009

Custom error pages in IIS

When creating a custom error page, you need to remember to update the feature settings within IIS.
First, set your error page for the correct status code. e.g. 404
Set IIS either to execute a URL or respond with a 302 redirect.
Then on the right hand action bar, click Edit Feature settings and select the option to use the custom error pages. If this is not done, IIS will still use the default error page.

Searching for a wildcard character in SQL

There are occasions when you need to search for the wildcard character within SQL.

The wildcard characters are:

  • % : Any string of zero or more characters.

  • _ : Any single character.

  • [ ] : Any single character within the specified range ([a-f]) or set ([abcdef]).

  • [^] : Any single character not within the specified range ([^a-f]) or set ([^abcdef]).

To search for any of these characters you need to use the ESCAPE clause.

To search for a text value that contains 10-15% you can use:

SELECT c1
FROM mytbl2
WHERE c1 LIKE '%10-15!% off%' ESCAPE '!'

Wednesday, 28 January 2009

ASP.NET MVC 1.0 Release Candidate Available

Microsoft have shipped the ASP.NET MVC 1.0 Release Candidate (RC). It's available to download from here. This is hopefully the last release before they ship the final release, which they are hoping to be next month.

The extensive release notes, all 26 pages detail the upgrade process from ASP.NET MVC Beta and includes all the details that have changed.

Wednesday, 14 January 2009

Move window to another monitor

I have two monitors and often find the need to move the window to the other monitor. Dragging the window and then maximising is slow and I wished to find a shortcut to this. reSizer is an application that deals with window enhancements, one of these enhancements is the ability to move a window to another monitor using the shortcut key Win + Backspace.

Thursday, 8 January 2009

Output literal text from XSLT

A colleague (Neil Pullinger) and my self have both come across the same problem. Getting the PICS tag to show correctly whilst using Sitecore. The example below is wrong, as the quotes have been escaped. <meta http-equiv="PICS-Label" content="(pics-1.1 &quot;http://www.icra.org/pics/vocabularyv03/&quot; I gen true for &quot;http://www.website.com&quot; r (n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 0))" /> The required output is: <meta http-equiv="PICS-Label" content='(pics-1.1 "http://www.icra.org/pics/vocabularyv03/" I gen true for "http://www.website.com" r (n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 0))' /> To achive the second option, we had to use
<xsl:text disable-output-escaping="yes">
    <![CDATA[<meta http-equiv="PICS-Label" content=']]>
</xsl:text>
<xsl:value-of select="$picsrating" />
<xsl:text disable-output-escaping="yes">
    <![CDATA[' />]]>
</xsl:text>

Friday, 2 January 2009

Blank <title> tags

If you are using ASP.NET and placehoders to render your metadata. You may notice that it will generate an empty <title> tag. This occurs when using XHTML 1.0 Transitional. I often use placeholders to control the content with in the title tag.

To overcome this, you can add the following in the head tag.

<head>
...
<title visible="false" runat="server"></title>
...
</head>

This turns the <title> tag into a server control, and the visible attribute prevents the blank title from rendering to the page.

Thursday, 1 January 2009

New Year = New Look

As it's the New Year I have decided to change the look of this blog. Also to note, my New Years resolution is to try and post here more often.

Happy New Year everyone.

Thursday, 4 December 2008

Label reference to non-existent ID

This can occur when you create a label tag to point to the ID of a text box.

<label for="email">Email address</label>
<asp:TextBox ID="email" Text="" runat="server"/>

But at render time ASP.NET changes the ID to something like ctl08_email

This can be rectified by replacing the following in the 'for' attribute.

<label for="<%= email.ClientID %>">


ASP.NET will now place the TextBox ID in the labels 'for' attribute.

Tuesday, 2 December 2008

Visual Studio Gridlines

You can place vertical gridlines in to the text editor for Visual Studio. This is useful if you have strict coding standards involving line lengths.

Open the registry
[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\9.0\Text Editor
Add a new string value and call it Guides
Add in the value RGB(191,205,219) 16, 80, where RGB is the colour, followed by up to 13 positions of the line. The above example is place a line after the 16th and 80th character.