Friday 17 October 2008

Intellisense not working in Visual Studio 2008

My Visual Studio 2008 stopped showing me intellisense the other day, unless I pressed Ctrl + Space. This was quite annoying as it is something I have come to rely on. After checking through all the settings, I stumbled across the "Statement Completion" options in Options -> Text Editor -> All Lanugages, these had all been unchecked, by what or how I don't know. I have now reset these options and Intellisense has returned.

Thursday 16 October 2008

EntityName error

Full Page Xhtml validation error produced the following:

Error: An error occurred while parsing EntityName. Line 47, position 193. [47, 193]

This wasn't helpful, but with some tracking down I found out that two items contains the & character that hadn't been escaped.

Solution: Escaped all Xhtml characters in text fields.

Friday 10 October 2008

Sitecore Page Editor showing input tags

Have you ever tried using the Sitecore page editor, only to find that when you click on edit you are presented with a screen full of tags:
<input id="fld_D2999F2E1BD441FA915E61CD65D09392_D3844EAD201947AF9D8C3BD340F05E8A_en_1_d2b36cfd9efc4068abcca16e543734c0_84" name="fld_D2999F2E1BD441FA915E61CD65D09392_D3844EAD201947AF9D8C3BD340F05E8A_en_1_d2b36cfd9efc4068abcca16e543734c0_84" value="privacy" type="hidden"><span class="scWebEditFrame" onmouseover="javascript:event.cancelBubble=true" style="display: none;"><span class="scWebEditFrameBorder"></span><span class="scWebEditFrameButtons"><span onmouseout="javascript:this.className='scWebEditFrameButton'" onclick="'javascript:return" onmouseover="javascript:this.className='scWebEditFrameButtonHover'" type="common" class="scWebEditFrameButton" title="Edit the related item"><img src="http://www.blogger.com/sitecore/images/blank.gif" class="scWebEditFrameButtonIcon" style="" alt="Edit the related item" border="0" /></span></span></span><span id="fld_D2999F2E1BD441FA915E61CD65D09392_D3844EAD201947AF9D8C3BD340F05E8A_en_1_d2b36cfd9efc4068abcca16e543734c0_84_edit" class="scWebEditInput" scfieldtype="single-line text" onkeyup="javascript:Sitecore.WebEdit.update(this,event)" oncut="javascript:Sitecore.WebEdit.update(this,event)" onpaste="javascript:Sitecore.WebEdit.update(this,event)" onmouseover="javascript:Sitecore.WebEdit.mouseOver(this,event)" onfocus="javascript:Sitecore.WebEdit.focus(this,event)" onblur="javascript:Sitecore.WebEdit.blur(this,event)" onclick="javascript:Sitecore.WebEdit.click(this,event,'sitecore://master/{D2999F2E-1BD4-41FA-915E-61CD65D09392}?lang=en&ver=1');" contenteditable="true">privacy</span>

To resolve this issue, you have to make sure that you disable output escaping:
<xsl:value-of select="$field" escaping="yes" />

Wednesday 8 October 2008

there is no attribute "name"

One of my favourite errors when trying to compile XHTML 1.0 Strict code. The fix is easy but one I always forget. Just add the following to the web.config within the <system.web> tag.

<xhtmlConformance mode="Strict" />

Thursday 2 October 2008

Attach to w3wp worker process

As a web developer I often need to attach to the worker process. Wouldn't it be nice if I could use a simple keystroke rather than following the process of selecting Debug -> Attach to process -> Then selecting the w3wp.

The following post has a macro that will do this for you, I wont take the credit for this solution:
http://blog.lavablast.com/post/2008/01/Attach-to-Process-with-one-shortcut.aspx

The post also tells you how to bind a shortcut to the macro. This tip saves me time and frustration.

UPDATE:
When logging in with a domain account, you need to change the following:

Dim compName As String = WindowsIdentity.GetCurrent().Name
compName = compName.Substring(0, compName.IndexOf("\"))


to

Dim compName As String = My.Computer.Name