Tuesday, 16 September 2008

Form action defaulting to layout

When using Sitecore the form tag sometimes defaults to the layout page rather than the current page. This has caught me out too many times, so I thought I should note it down below.

Solution:

  • Ensure that the App_Browser folder is in the root folder

  • Ensure that the App_Browser folder is not hidden.

Thursday, 11 September 2008

ISAPI Rewrite Disable option

One of my favourite rules in ISAPI Rewrite is the DisableRewrite as it allows you to turn of the rules for sites that don't require URL changes. This is useful as I run many sites side by side, some of which require this filter.
I can add the following line for each of the sites that doesn't need any rules.

DisableRewrite "default site"

Friday, 5 September 2008

Windows Server 2008 Send To menu

If like me, you like to customize your Send To menu so you can open documents in your favourite editor, Programmer's Notepad being one of mine. Then just paste this in to the run command:
%UserProfile%\Appdata\Roaming\Microsoft\Windows\Sendto

The AppData folder is hidden by default, hence why I could't find it when I went searching.

Thursday, 4 September 2008

Triming strings to whole words in C#

This is a method that I have found useful whilst having to trim a string to a number of chars, whilst keeping whole words.

public string TrimToNumberOfChars (string originalString, int maxChar)
{
if (originalString.Length <= maxChar)
return originalString;

int lastSpace = originalString.LastIndexOf(" ", maxChar - 1);
if (lastSpace == -1) return "";
return originalString.Substring(0, lastSpace) + "...";
}

I hope other people find this useful.

Wednesday, 3 September 2008

Google Chrome

Google Chrome as been released as Beta this morning. This is a new browser built from the ground up. You can download it here.

This is a short cartoon comic that describes Google's approach to Chrome.

I hope to add more on this new browser as I play around with it.