<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Richard's Blog</title>
	<atom:link href="http://richdias.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://richdias.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 16 Dec 2011 15:08:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='richdias.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Richard's Blog</title>
		<link>http://richdias.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://richdias.wordpress.com/osd.xml" title="Richard&#039;s Blog" />
	<atom:link rel='hub' href='http://richdias.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Blog has moved!</title>
		<link>http://richdias.wordpress.com/2011/03/31/blog-moved/</link>
		<comments>http://richdias.wordpress.com/2011/03/31/blog-moved/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 00:10:00 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=59</guid>
		<description><![CDATA[I have now moved my blog to http://www.cmssource.co.uk/blog<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=59&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have now moved my blog to <a title="cmssource blog" href="http://cmssource.co.uk/blog">http://www.cmssource.co.uk/blog</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=59&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2011/03/31/blog-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitecore and Telligent Community Integration</title>
		<link>http://richdias.wordpress.com/2010/03/29/sitecore-and-telligent-community-integration/</link>
		<comments>http://richdias.wordpress.com/2010/03/29/sitecore-and-telligent-community-integration/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 09:01:56 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[.NET 2]]></category>
		<category><![CDATA[Sitecore v6]]></category>
		<category><![CDATA[Telligent Community Server]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=53</guid>
		<description><![CDATA[You may have read the following article: http://www.cmswire.com/cms/web-cms/sitecore-and-telligent-integrate-for-better-online-engagement-005991.php This claims that Sitecore and Telligent have integrated to make a convenient solution combining the power of a social networking/collaboration platform with the flexibility of a CMS system. There is a fairly complicated white-paper that has been published by Sitecore which is split into two parts: Security Integration [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=53&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You may have read the following article:</p>
<p><span style="color:#000000;"><span style="font-family:Arial;"><span style="font-size:small;"><a href="http://www.cmswire.com/cms/web-cms/sitecore-and-telligent-integrate-for-better-online-engagement-005991.php">http://www.cmswire.com/cms/web-cms/sitecore-and-telligent-integrate-for-better-online-engagement-005991.php</a></span></span></span></p>
<p>This claims that Sitecore and Telligent have integrated to make a convenient solution combining the power of a social networking/collaboration platform with the flexibility of a CMS system.</p>
<p>There is a fairly complicated white-paper that has been published by Sitecore which is split into two parts:</p>
<ol>
<li>Security Integration</li>
<li>Content management integration</li>
</ol>
<p>This solution is not as straight forward as it sounds and it is very poorly supported . . . . I strongly suggest that you do not waste your time heading down this path if you can avoid it. It provides a way for you to use community functionality within a Sitecore site (not the other way around  . . . in case you were thinking about pulling Sitecore content into a community site). The solution is out dated and will not work with the latest versions of Sitecore.</p>
<p>We needed to Drive a Community server site and pull Content + Media out of Sitecore which will be used within Telligent community server via Widgets. We also embedded content from Sitecore directly into some of the community theme aspx files. The Community server web site also needed the ability to upload media items directly into Sitecore.</p>
<p>I found that the best method to pull out content from Sitecore into another web application is via a <strong>Web Service </strong>or potentially a REST service which will run within the Sitecore web application. This will give you the access required to Update/Create Sitecore content via a separate web application.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=53&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2010/03/29/sitecore-and-telligent-community-integration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up a Sitecore project works with both versions 5.3 and 6</title>
		<link>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/</link>
		<comments>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 01:31:29 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Sitecore v6]]></category>
		<category><![CDATA[Visual Studio 2005]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[Sitecore project structure]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=24</guid>
		<description><![CDATA[Sitecore(SC) has a decent article on how to set up a Sitecore project on Visual Studio. This is a pretty good start but it does not quite meet our company&#8217;s requirements. In this blog post I will attempt to tell you exactly how a structure a project assuming that you have the following requirements for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=24&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sitecore(SC) has a decent article on how to set up a Sitecore project on Visual Studio. This is a pretty good start but it does not quite meet our company&#8217;s requirements.</p>
<p>In this blog post I will attempt to tell you exactly how a structure a project assuming that you have the following requirements for your SC environment:</p>
<ul>
<li>You need to have multiple websites running on one instance of SC and you want each website to have its own Visual Studio project.</li>
<li>You are not using a virtual folder per website.</li>
<li>You want to manage multiple Class Library/Child projects within each website project.</li>
<li>You want to keep the Renderings, Sub-layouts, Layouts, Associated files (css, js etc) and DLL&#8217;s of each website independent.</li>
</ul>
<p>Our company has worked with multiple projects in Sitecore v5.3 and we have also Started a new project using Sitecore v6 (Visual Studio 2005 and 2008). I can safely say that we have come up with a tried and proven project structure that I can recommend that everyone can and should use. Please follow the SC developer cookbook if you are only going to ever have one website running on your instance of SC.</p>
<p><em>There is a fair bit to write on this entry and I will be slowly updating it, if anyone is in desperate need to this information right now then please leave a comment and I will try to speed things up!</em></p>
<p><span id="more-24"></span></p>
<p><strong>HTML File Structure</strong></p>
<p>It is always good to have a well structured website. Our team deals with the integration of HTML front end with SC. For this reason we usually get out HTML, CSS and JS delivered to us from a 3&#8242;rd party vendor. We get them to deliver the HTML to us in the following structure so that it fits snugly in with our intended .NET project structure:</p>
<p style="text-align:left;"><a href="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif"><img class="size-large wp-image-33 aligncenter" title="html structure" src="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif?w=450&#038;h=319" alt="" width="450" height="319" /></a></p>
<p>Our website will be called &#8220;<em><strong>destinations</strong></em>&#8220;. Our main HTML files are on the highest level and we have folder named &#8216;destinations&#8217; which contains all the css, images, JS etc. (the HTML will reference these files like this &lt;img src=&#8221;/destinations/img/image1.jpg&#8221;/&gt; )</p>
<p style="text-align:left;">Obviously the HTML is just your reference, we will be splitting up all the HTML into Layouts, Sublayouts and Renderings. Only the &#8216;destinations&#8217; folder and its contents will actually be part of our Visual Studio project.</p>
<p style="text-align:left;">Had a Discussion with Elliot who posted comment on this topic. I have pasted the discussion we have had below (<strong>read from bottom up</strong>):</p>
<p style="text-align:left;">
<p style="text-align:left;">HI Eliot,</p>
<p>Sounds like a good approach, we did think of doing it the way you did but we decided not to go ahead with is simply because the Cookbook suggests that all websites are created and run via the website folder.</p>
<p>Even when you do my method, you should only be having the newly created web app in your VS project. You should not need to import any sitecore objects (it should effectively have been the same as your independent virtual directory arrangement). I.e. as mentioned, each website does have its own web.app even tho they have all been moved into the sitecore/websites folder.</p>
<p>I am assuming sitecore&#8217;s web.config will be the failover web.config is your local web.app does not contain any web.config entries that have been tweaked for that site?</p>
<p>Are your URL&#8217;s looking consistent when viewing a web page in preview mode now that you have created the Virtual Folders?<br />
I can&#8217;t really think of any potential issues with your configuration at the moment and if you do manage to avoid any problems this may well be the best soloution structure yet.</p>
<p>Keep me informed.<br />
Thanks,<br />
<span style="color:#888888;">Richard</span></p>
<p>On Fri, Jan 16, 2009 at 5:12 AM, Elliot Ritchie wrote:<br />
Hi Richard</p>
<p>After experimenting with a ton of different configurations I think I&#8217;ve found the ideal way to integrate Sitecore with the current processes and project structures I&#8217;m working with right now; you&#8217;re directions definately provided a leap in the right direction!</p>
<p>Essentially,</p>
<ul>
<li>Each website sits within its own web application that contains all the necessary css, images, renderings and layouts etc for the specific website.</li>
<li>The web applications then reference the Sitecore assemblies from a single predetermined Sitecore installation directory (this also allows for a much more efficient use of source control systems as it means each version controlled website doesn&#8217;t have to also include 300mb+ worth of Sitecore modules).</li>
<li>The web applications&#8217; Web.config contain the necessary Sitecore configuation sections, tweaked for the specific website.</li>
<li>In IIS each web application is setup as its own website, with a virtual directory setup in each to provide the reference to the &#8216;/sitecore/&#8217; directory, again this virtual directory points to the same predetermined Sitecore installation directory as before.</li>
</ul>
<p>If you can see any holes in this setup please let me know, or any thoughts in general, but so far everything is running great!</p>
<p>Many Thanks</p>
<div>
<p>Elliot</p>
<hr />Date: Wed, 14 Jan 2009 10:15:07 +0530<br />
Subject: Sitecore Project structure<br />
From: Me<br />
To: Elliot</div>
<p>Hi Elliot,</p>
<p>I can&#8217;t really update my Blog at the moment because I am on holiday ( I will be working purely off memory). I have been pretty lazy with that I must admit.<br />
Will try to outline the steps here (I will assume your project is called <em>destinations</em> following from my HTML structure blog post:</p>
<ol>
<li>You will need to follow the Sitecore developer cook book and create a project as described there (name the project DestinationsApp for consistency) within the sitecore/websites folder.</li>
<li>Given that you will be working with multiple projects (websites) then you will need to have more than one &#8216;properties&#8217; folder (one is needed for each project solution) so you will need to rename the Properties folder to something like DestinationsProperties.Once you have done this you will need to edit the DestinationsApp project (.csj I think) file with a text editor and replace all instances of the &#8216;properties&#8217; folder name to match your new &#8216;DestinationsProperties&#8217; folder name. Close this file and you are ready to open the project &#8211; go ahead and add a reference to Sitecore.Kernal.dll and dont forget to set copyLocal to <em>false</em>.</li>
<li>Now that you have a basic Web App project there you can start adding the extra sections to this project. Create a folder within sitecore/website named &#8216;destinations&#8217;. Include this newly created folder in your DestinationsApp project because this will contain all the misc web files. Copy all the files from your HTML/destinations folder into the sitecore/website/destinations folder.</li>
<li>Within the sitecore/websites/layouts folder create a folder called &#8216;destinations&#8217;. Include this folder in the DestinationsApp project. All your <strong>layouts </strong>and <strong>sublayouts </strong>for the destinations website should be created here within the sitecore/websites/layouts/destinations folder. You can reference your css files and image files (that will be in the folder created at step 3) from all layouts and renderings by refering to the src/link like this: &lt;img src=\destinations\img\image1.jpg /&gt;</li>
<li>Within the sitecore/websites/xsl folder create a folder called &#8216;destinations&#8217;. Include this folder in the DestinationsApp project. All your <strong>renderings </strong>for the destinations website should be created here within the sitecore/websites/xsl/destinations folder.</li>
<li>Now you should be ready to go with the creation of a basic website. I suggest that in your Content tree you start off your content within sitecore/content/destinations/home where Home will be your home page. When you have a second website to go in your sitecore instance then that can be located within sitecore/content/secondwebsite/home in the content tree. You will ofcourse need to change the web.config &lt;sites&gt; section to add each website.</li>
<li>We often have accompanying DLL class libraries (e.d. a DestinationsLogic class library project) and also a Database project when integrating 3&#8242;rd party DB&#8217;s with your sitecore website. I highly reccomend that you create and store these projects outside of your &#8216;sitecore/website&#8217; folder because the goal is to keep the sitecore/website folder a clutter-free as possible. Create a filder within the C drive called c:/DestinationsProjects and then create two seperate folders in here for DestinationsLogic and DestinationsDB. Add your extra projects in here and by all means create these projects by &#8216;adding new project&#8217; to your DestinationsApp project solution. This way all your projects will be logically in the same Visual Studio solution but Physically seperate. Add a Reference to each of these projects in your DestinationsApp project (and leave copyLocal as <em>true</em>) so that each time you compile your solution a <strong>DestinationsLogic.dll</strong> will be created in the sitecore/website/bin folder.</li>
<li>When you have this structure set up, you can easily add more websites to your sitecore instance by following steps 1 to 8 for each new websites and just replacing the word &#8216;Destinations&#8217; with the name of your new website and they will all co-exsist without problems and you will end up with a highly maintainable, clutter-free project/site structure.</li>
</ol>
<p>Hope this helps,<br />
Richard</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=24&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif?w=450" medium="image">
			<media:title type="html">html structure</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET service faulting error Sitecore 6 workaround</title>
		<link>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/</link>
		<comments>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 22:57:21 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Sitecore 6]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=21</guid>
		<description><![CDATA[We have sitecore 6 environments working on Virtual Machines (VM&#8217;s). Sitecore 6 seems to cause an ASP error at seemingly random intervals leading to a total loss of service 9only on VM&#8217;s. Event Viewer will show you the following error: Event Type: Error Event Source: Application Error Event Category: (100) Event ID: 1000 Date:  8/8/2008 Time:  4:09:35 PM User:  N/A Computer: SCTEST Description: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=21&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have sitecore 6 environments working on Virtual Machines (VM&#8217;s). Sitecore 6 seems to cause an ASP error at seemingly random intervals leading to a total loss of service 9only on VM&#8217;s. Event Viewer will show you the following error:</p>
<p><span style="font-family:Courier New;font-size:x-small;"><strong>Event Type: Error<br />
Event Source: Application Error<br />
Event Category: (100)<br />
Event ID: 1000<br />
Date:  8/8/2008<br />
Time:  4:09:35 PM<br />
User:  N/A<br />
Computer: SCTEST<br />
Description:<br />
Faulting application w3wp.exe, version 6.0.3790.3959, faulting module unknown, version 0.0.0.0, fault address 0x709a2075.</strong></span></p>
<p>Sitecore have provided a work-around for this. Set the following web.config entry to &#8216;false&#8217; as show below:</p>
<p>&lt;!&#8211;  ENABLE COUNTERS<br />
Indicates if performance counters are enabled.<br />
Default value: true<br />
&#8211;&gt;<br />
&lt;setting name=&#8221;Counters.Enabled&#8221; value=&#8221;false&#8221; /&gt;</p>
<p>We have made this change and it seems to get rid of the issue. Seems like Sitecores backend performance monitoring may be using some .NET 3.5 functionality that causes this error (this is just a guess).</p>
<p>See the SC forum for more details:</p>
<p>http://sdn5.sitecore.net/forum/ShowPost.aspx?PostID=11838#11838</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=21&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>
	</item>
		<item>
		<title>How to destroy a cookie C#.NET</title>
		<link>http://richdias.wordpress.com/2008/02/05/how-to-destroy-a-cookie-cnet/</link>
		<comments>http://richdias.wordpress.com/2008/02/05/how-to-destroy-a-cookie-cnet/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 02:09:43 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[.NET 2]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET 2]]></category>
		<category><![CDATA[C#.NET 2]]></category>
		<category><![CDATA[Destroy cookie]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=13</guid>
		<description><![CDATA[Basically have to set its expire date to the past! (the cookies we created for our site lasted a day so -1d was enough for this example) public void DestroyCookie(string cookieName)     {         if (HttpContext.Current.Request.Cookies[cookieName] != null)         {             HttpCookie myCookie = new HttpCookie(cookieName);             myCookie.Expires = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=13&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Basically have to set its expire date to the past! (the cookies we created for our site lasted a day so -1d was enough for this example)</p>
<div style="font-size:10pt;background:white;color:black;font-family:Courier New;">
<p style="margin:0;"><span style="color:blue;">public</span> <span style="color:blue;">void</span> DestroyCookie(<span style="color:blue;">string</span> cookieName)</p>
<p style="margin:0;">    {</p>
<p style="margin:0;">        <span style="color:blue;">if</span> (<span style="color:#2b91af;">HttpContext</span>.Current.Request.Cookies[cookieName] != <span style="color:blue;">null</span>)</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:#2b91af;">HttpCookie</span> myCookie = <span style="color:blue;">new</span> <span style="color:#2b91af;">HttpCookie</span>(cookieName);</p>
<p style="margin:0;">            myCookie.Expires = <span style="color:#2b91af;">DateTime</span>.Now.AddDays(-1d);</p>
<p style="margin:0;">            <span style="color:#2b91af;">HttpContext</span>.Current.Response.Cookies.Add(myCookie);</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">    }</p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=13&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/05/how-to-destroy-a-cookie-cnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>
	</item>
		<item>
		<title>Use your own Authentication</title>
		<link>http://richdias.wordpress.com/2008/02/05/use-your-own-authentication/</link>
		<comments>http://richdias.wordpress.com/2008/02/05/use-your-own-authentication/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 02:05:01 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[C#.NET Cryptography]]></category>
		<category><![CDATA[Password hashing]]></category>
		<category><![CDATA[System.Security.Cryptography]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=14</guid>
		<description><![CDATA[I didnt want to use Forms Authentication once and I decided to make my own password hashing just for the hell of it, here is a very simple implementation. The goal was to save a user and the users password as a hash + a random salt string for increased security. Also wanted to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=14&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I didnt want to use Forms Authentication once and I decided to make my own password hashing just for the hell of it, here is a very simple implementation.<br />
The goal was to save a user and the users password as a hash + a random salt string for increased security.<br />
Also wanted to be able to generate a new password and have a hash + salt created for that new password I generated as can be seen from the following interface <em>Crypto.cs</em>.<br />
Note: Yay downloaded a tool that actually Generated HTML from my code properly!! from <a target="_blank" href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/" title="Generate HTML from VS code.">here</a>.</p>
<div style="font-size:10pt;background:white;color:black;font-family:Courier New;">
<p style="margin:0;"><span style="color:blue;">using</span> System;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Collections.Generic;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Text;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">namespace</span> PassEncrypt</p>
<p style="margin:0;">{</p>
<p style="margin:0;">    <span style="color:blue;">interface</span> <span style="color:#2b91af;">Crypto</span></p>
<p style="margin:0;">    {</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">  Gets the Hash key and Salt for a specific</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">  password.  </span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Will return a string with three elements       </span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    1. Hash Key</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    2. Salt</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">string</span>[] GenerateKeySalt( <span style="color:blue;">string</span> plainTxtPass );</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">  Change the password.</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">  </span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Will return a string with three elements</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    1. New Password</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    2. Hash Key</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    3. Salt</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">string</span>[] GenerateNewPassword();</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:blue;">string</span> GetHashKey(<span style="color:blue;">string</span> input);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">    }</p>
<p style="margin:0;">}</p>
</div>
<p>And now to implement this interface with the <em>Encrypt.cs</em> class (p.s. Man I am lowing this new HTML generation from Code tool):</p>
<div style="font-size:10pt;background:white;color:black;font-family:Courier New;">
<p style="margin:0;"><span style="color:blue;">using</span> System;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Collections.Generic;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Text;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Security.Cryptography;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">namespace</span> PassEncrypt</p>
<p style="margin:0;">{</p>
<p style="margin:0;">    <span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Encrypt</span> : <span style="color:#2b91af;">Crypto</span></p>
<p style="margin:0;">    {</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #region</span> Generate the Hash key and salt for a given password</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Returns a salt value and a hash key to be stored</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> in the database for the given user.</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;plainTxtPass&#8221;&gt;&lt;/param&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">string</span>[] GenerateKeySalt(<span style="color:blue;">string</span> plainTxtPass)</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:blue;">string</span>[] s = <span style="color:blue;">new</span> <span style="color:blue;">string</span>[2];</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">string</span> salt = GenerateRandomSalt();</p>
<p style="margin:0;">            <span style="color:blue;">string</span> passAndSalt = plainTxtPass + salt;</p>
<p style="margin:0;">            <span style="color:blue;">string</span> hash = GetHashKey(passAndSalt);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            s[0] = hash;</p>
<p style="margin:0;">            s[1] = salt;</p>
<p style="margin:0;">            <span style="color:blue;">return</span> s;</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #endregion</span></p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #region</span> Generate a new password</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Generates a new random password and returns a string array with:</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    1. new password</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    2. hash key</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;">    3. salt value</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">string</span>[] GenerateNewPassword()</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:blue;">string</span>[] s = <span style="color:blue;">new</span> <span style="color:blue;">string</span>[3];</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:#2b91af;">RandomPassword</span> randPassGenerator = <span style="color:blue;">new</span> <span style="color:#2b91af;">RandomPassword</span>();</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">string</span> newPass = randPassGenerator.GetPassword();     </p>
<p style="margin:0;">            <span style="color:blue;">string</span> salt = GenerateRandomSalt();</p>
<p style="margin:0;">            <span style="color:blue;">string</span> passAndSalt = newPass + salt;</p>
<p style="margin:0;">            <span style="color:blue;">string</span> hash = GetHashKey(passAndSalt);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            s[0] = newPass;</p>
<p style="margin:0;">            s[1] = hash;</p>
<p style="margin:0;">            s[2] = salt;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">return</span> s;</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #endregion</span></p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #region</span> Generate random salt</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Generates a cryptographically strong salt string</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">string</span> GenerateRandomSalt()</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:#2b91af;">RNGCryptoServiceProvider</span> crypto = <span style="color:blue;">new</span> <span style="color:#2b91af;">RNGCryptoServiceProvider</span>();</p>
<p style="margin:0;">            <span style="color:blue;">byte</span>[] saltInBytes = <span style="color:blue;">new</span> <span style="color:blue;">byte</span>[5];</p>
<p style="margin:0;">            crypto.GetBytes(saltInBytes);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">return</span> <span style="color:#2b91af;">Convert</span>.ToBase64String(saltInBytes);</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #endregion</span></p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #region</span> Get the hash key for a given string</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">string</span> GetHashKey(<span style="color:blue;">string</span> input)</p>
<p style="margin:0;">        {           </p>
<p style="margin:0;">            <span style="color:blue;">byte</span>[] tmpSource;</p>
<p style="margin:0;">            <span style="color:blue;">byte</span>[] tmpHash;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:green;">//Convert input to a Byte Array (needed for hash function)</span></p>
<p style="margin:0;">            tmpSource = <span style="color:#2b91af;">ASCIIEncoding</span>.ASCII.GetBytes(input);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:green;">//Compute hash based on source data.</span></p>
<p style="margin:0;">            tmpHash = <span style="color:blue;">new</span> <span style="color:#2b91af;">MD5CryptoServiceProvider</span>().ComputeHash(tmpSource);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">return</span> <span style="color:#2b91af;">Convert</span>.ToBase64String(tmpHash);</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">        #endregion</span></p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">    }</p>
<p style="margin:0;">}</p>
</div>
<p>The following class (<em>RandomPassword.cs</em>) contains my Random password generator. You may want to modify it according to the type of password you would like to generate:</p>
<div style="font-size:10pt;background:white;color:black;font-family:Courier New;">
<p style="margin:0;"><span style="color:blue;">using</span> System;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Collections.Generic;</p>
<p style="margin:0;"><span style="color:blue;">using</span> System.Text;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:blue;">namespace</span> PassEncrypt</p>
<p style="margin:0;">{</p>
<p style="margin:0;">    <span style="color:blue;">class</span> <span style="color:#2b91af;">RandomPassword</span></p>
<p style="margin:0;">    {</p>
<p style="margin:0;">        <span style="color:blue;">private</span> <span style="color:blue;">int</span> RandomNumber(<span style="color:blue;">int</span> min, <span style="color:blue;">int</span> max)</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:#2b91af;">Random</span> random = <span style="color:blue;">new</span> <span style="color:#2b91af;">Random</span>();</p>
<p style="margin:0;">            <span style="color:blue;">return</span> random.Next(min, max);</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> Generates a random string with the given length</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;size&#8221;&gt;</span><span style="color:green;">Size of the string</span><span style="color:gray;">&lt;/param&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;param name=&#8221;lowerCase&#8221;&gt;</span><span style="color:green;">If true, generate lowercase string</span><span style="color:gray;">&lt;/param&gt;</span></p>
<p style="margin:0;">        <span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;returns&gt;</span><span style="color:green;">Random string</span><span style="color:gray;">&lt;/returns&gt;</span></p>
<p style="margin:0;">        <span style="color:blue;">private</span> <span style="color:blue;">string</span> RandomString(<span style="color:blue;">int</span> size, <span style="color:blue;">bool</span> lowerCase)</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:#2b91af;">StringBuilder</span> builder = <span style="color:blue;">new</span> <span style="color:#2b91af;">StringBuilder</span>();</p>
<p style="margin:0;">            <span style="color:#2b91af;">Random</span> random = <span style="color:blue;">new</span> <span style="color:#2b91af;">Random</span>();</p>
<p style="margin:0;">            <span style="color:blue;">char</span> ch;</p>
<p style="margin:0;">            <span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = 0; i &lt; size; i++)</p>
<p style="margin:0;">            {</p>
<p style="margin:0;">                ch = <span style="color:#2b91af;">Convert</span>.ToChar(<span style="color:#2b91af;">Convert</span>.ToInt32(<span style="color:#2b91af;">Math</span>.Floor(26 * random.NextDouble() + 65)));</p>
<p style="margin:0;">                builder.Append(ch);</p>
<p style="margin:0;">            }</p>
<p style="margin:0;">            <span style="color:blue;">if</span> (lowerCase)</p>
<p style="margin:0;">                <span style="color:blue;">return</span> builder.ToString().ToLower();</p>
<p style="margin:0;">            <span style="color:blue;">return</span> builder.ToString();</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">string</span> GetPassword()</p>
<p style="margin:0;">        {</p>
<p style="margin:0;">            <span style="color:#2b91af;">StringBuilder</span> builder = <span style="color:blue;">new</span> <span style="color:#2b91af;">StringBuilder</span>();</p>
<p style="margin:0;">            builder.Append(RandomString(4, <span style="color:blue;">true</span>));</p>
<p style="margin:0;">            builder.Append(RandomNumber(1000, 9999));          </p>
<p style="margin:0;">            <span style="color:blue;">return</span> builder.ToString();</p>
<p style="margin:0;">        }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">    }</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">}</p>
</div>
<p>Thats all there is to it. I just made this is a class library project names PassEncrypt.</p>
<p><img src="http://richdias.files.wordpress.com/2008/02/crypto-project.jpg?w=450" alt="crypto-project.jpg" /></p>
<p>Just reference PassEncrypt and:<br />
For a new user send their password in and get an array containing the [hash,salt],  store these somewhere and associate them with the username:</p>
<div style="font-size:10pt;background:white;color:black;font-family:Courier New;">
<p style="margin:0;"><span style="color:blue;">    #region</span> Get Hashed password</p>
<p style="margin:0;">    <span style="color:blue;">public</span> <span style="color:blue;">bool</span> GetHashPassword(<span style="color:blue;">string</span> username, <span style="color:blue;">string</span> password)</p>
<p style="margin:0;">    {</p>
<p style="margin:0;">        <span style="color:#2b91af;">Encrypt</span> crypt = <span style="color:blue;">new</span> <span style="color:#2b91af;">Encrypt</span>();</p>
<p style="margin:0;">        <span style="color:blue;">string</span> user = username;</p>
<p style="margin:0;">        <span style="color:blue;">string</span> pwd = password;</p>
<p style="margin:0;">        <span style="color:blue;">string</span> salt = <span style="color:#a31515;">&#8220;&#8221;</span>;</p>
<p style="margin:0;">        salt = dataService.GetUserSalt(user);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">            <span style="color:blue;">if</span> (salt != <span style="color:#a31515;">&#8220;&#8221;</span>)</p>
<p style="margin:0;">            {</p>
<p style="margin:0;">                <span style="color:blue;">string</span> passHash = dataService.GetUserHash(user);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">                <span style="color:blue;">string</span> resultHash = crypt.GetHashKey(pwd + salt);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">                <span style="color:blue;">if</span> (passHash == resultHash)</p>
<p style="margin:0;">                { <span style="color:green;">//Password Correct</span></p>
<p style="margin:0;">                    <span style="color:blue;">return</span> <span style="color:blue;">true</span>;</p>
<p style="margin:0;">                }</p>
<p style="margin:0;">                <span style="color:blue;">else</span></p>
<p style="margin:0;">                {</p>
<p style="margin:0;">                    <span style="color:blue;">return</span> <span style="color:blue;">false</span>;</p>
<p style="margin:0;">                }</p>
<p style="margin:0;">            }</p>
<p style="margin:0;">            <span style="color:blue;">else</span></p>
<p style="margin:0;">                <span style="color:blue;">return</span> <span style="color:blue;">false</span>;</p>
<p style="margin:0;">    }</p>
<p style="margin:0;"><span style="color:blue;">    #endregion</span></p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=14&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/05/use-your-own-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/crypto-project.jpg" medium="image">
			<media:title type="html">crypto-project.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitecore &#8211; Store Multilist related content within local item on save</title>
		<link>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/</link>
		<comments>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 00:50:18 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[multilist]]></category>
		<category><![CDATA[on save]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=8</guid>
		<description><![CDATA[The Requirement Our clients have &#8216;subject&#8217; and &#8217;function&#8217; Metadata fields within their web page. They wanted to be able to content manage this subject and function list . They then wanted to be able to assign a subset of these function and subject keywords into each web page item (so all the subjects and functions are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=8&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Requirement</strong></p>
<p>Our clients have &#8216;subject&#8217; and &#8217;function&#8217; Metadata fields within their web page. They wanted to be able to content manage this subject and function list . They then wanted to be able to assign a subset of these function and subject keywords into each web page item (so all the subjects and functions are common to the whole site).</p>
<p><strong>The Problem</strong></p>
<p>The cleanest solution to this problem was to define a bunch of simple text items for each of the subjects and functions within specfic folder items. We would then create two multi lists in the Metadata base template (one for subject and one for function) and point them at these respective source directories.</p>
<p>Now think of the situation:  We have 5 subjects and 3 functions on average per web page. In the background, we are going to have to pull out data from 8 related content items every time we load a given page. We did not want to do this so we devised a simple work-around that would let us retain the useability of the method discussed above but also ave all this related content available on the one item when it needs to be served up.</p>
<p><strong>The Solution</strong> (I will be using a simple &#8216;Category&#8217; multilist example as a demo here)</p>
<p>We added two hidden (not visible to author) text field within the Metadata base template to correspond with each multilist. These two text fields will contain the content (not the Id&#8217;s) of the &#8216;Description&#8217; field of the referenced items seperating each with a &#8216;|&#8217; delimeter as can be seen below.<br />
<a href="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.jpg" title="multilistcontentfieldshiddenfield.jpg"></a></p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.jpg"><img src="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.thumbnail.jpg?w=450" alt="multilistcontentfieldshiddenfield.jpg" /></a></p>
<p> The categories associate to a simple text field item which <strong>must </strong>have a field named &#8216;Description&#8217; within it:</p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.jpg"><img src="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.thumbnail.jpg?w=450" alt="categoriesitem-template.jpg" /></a></p>
<p>All the categories should lie within a common folder item so that we can point our multilist source at that folder:</p>
<p><a target="_blank" href="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.jpg"><img src="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.thumbnail.jpg?w=450" alt="categoriescontenttree.jpg" /></a></p>
<p>In the template that holds the multilist, make sure that you create a text field with the name &#8216;chosen &#8216; + &lt;multilist name&gt;. I.e. in our example, our multilist is named &#8216;Categories&#8217;, so our hidden text field will be called &#8216;Chosen Categories&#8217;</p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.jpg"><img src="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.thumbnail.jpg?w=450" alt="multilistreferencetemplate.jpg" /></a><a href="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.jpg" title="multilistreferencetemplate.jpg"></a></p>
<p>Now we create an OnSaving event which does the following:</p>
<p>1. Check if the item thats being saved contains any multilists</p>
<p> 2. If 1 = true, then for each multilist named &lt;name&gt; in the current item</p>
<p>3. Check if there is a field named &#8216;Chosen &#8216; + &lt;name&gt; (of the current multilist) from 2</p>
<p>4. If 3 = true, then clear the &#8216;Chosen &#8216; + &lt;name&gt; field of its content; retrieve all the items referenced by the current multilist; For each of these items check if a &#8216;Description&#8217; field exists; if &#8216;Description&#8217; exists and there is content within it, add this content to &#8216;Chosen &#8216; + &lt;name&gt;</p>
<p>I have pasted the code for the <em>ItemOnSavingEvents.cs</em> class here (sorry about the indentation, copy/paste into blog isnt the best):</p>
<p><font size="2">using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using Sitecore;<br />
using Sitecore.Data.Events;<br />
using Sitecore.Data;<br />
using System.Collections;   </font></p>
<p><font size="2">namespace SitecoreSCD1Labs<br />
{<br />
    public class ItemOnSavingEvents<br />
    {<br />
        public void OnItemSavingPopulateHidenFields(object sender, EventArgs args)<br />
        {<br />
            Sitecore.Data.Items.Item item = Sitecore.Events.Event.ExtractParameter(args, 0) as Sitecore.Data.Items.Item;<br />
           <br />
            Sitecore.Collections.FieldCollection fields = item.Fields;</font></p>
<p><font size="2">            foreach( Sitecore.Data.Fields.Field field in fields ) {<br />
                if (field.Type == &#8220;multilist&#8221;)<br />
                {<br />
                    Sitecore.Data.Fields.MultilistField mlf = (Sitecore.Data.Fields.MultilistField)field;<br />
                    String fieldname = field.Name;</font></p>
<p><font size="2">                    if( item.Fields["chosen " + fieldname] != null ) { //Hidden field for corresponding multilist exists<br />
                        Sitecore.Data.Fields.Field hiddenField = item.Fields["chosen " + fieldname];<br />
                        hiddenField.SetValue(&#8220;&#8221;, false);</font></p>
<p><font size="2"><br />
                        //Populate the hidden field with the descriptions from the related items (pipe delimitered)<br />
                        String[] relatedItemGuids = mlf.Items;<br />
                         <br />
                        foreach (String guid in relatedItemGuids)<br />
                        {<br />
                            Sitecore.Data.Database currentDB = Sitecore.Configuration.Factory.GetDatabase(&#8220;master&#8221;);<br />
                            Sitecore.Data.Items.Item relatedItem = currentDB.Items.GetItem(guid);</font><font size="2">                            if (relatedItem != null)<br />
                            {<br />
                                if (relatedItem.Fields["description"] != null)<br />
                                    if (hiddenField.ToString() == &#8220;&#8221;)<br />
                                        hiddenField.SetValue(relatedItem.Fields["description"].ToString(), false);<br />
                                    else<br />
                                        hiddenField.SetValue(hiddenField.ToString() + &#8220;|&#8221; + relatedItem.Fields["description"].ToString(), false);</font><font size="2">                            }<br />
                        }      <br />
                    }<br />
                }<br />
            }<br />
        }<br />
    }<br />
}<br />
</font><font size="2"></font><font size="2"> Add a web.config entry in the Item onsave event to run your code:</font><font size="2">&lt;event name=&#8221;item:saving&#8221;&gt;<br />
   &lt;handler type=&#8221;SitecoreSCD1Labs.ItemOnSavingEvents, SitecoreSCD1Labs&#8221; method=&#8221;OnItemSavingPopulateHidenFields&#8221; /&gt;<br />
  &lt;/event&gt;</font><font size="2"><strong>Drawbacks of this solution</strong></font><font size="2">Unfortunately if the content author changes an existing subject or function then the current items will not automatically change to reflect the new update. The new change will only get reflected on existing items once those items get <em>edited</em> for any reason and re-saved (I have found that some edit needs to be made, i.e. even a smal re-sort of one of the metadata multilist fields, otherwise the item:onsave event does not fire even if save is clicked). In our case the user will most likely only add new subjects and functions and not change existing ones.</p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=8&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.thumbnail.jpg" medium="image">
			<media:title type="html">multilistcontentfieldshiddenfield.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.thumbnail.jpg" medium="image">
			<media:title type="html">categoriesitem-template.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.thumbnail.jpg" medium="image">
			<media:title type="html">categoriescontenttree.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.thumbnail.jpg" medium="image">
			<media:title type="html">multilistreferencetemplate.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitecore &#8211; Custom Text Field</title>
		<link>http://richdias.wordpress.com/2008/02/03/hello-world/</link>
		<comments>http://richdias.wordpress.com/2008/02/03/hello-world/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 23:06:11 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Custom field type]]></category>
		<category><![CDATA[Custom Text Field]]></category>
		<category><![CDATA[Field Type]]></category>
		<category><![CDATA[MacroText.cs]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In this blog I will describe how to create a very simple Custom Text field in Sitecore. I have based this off the example of a custom checkbox field that can be found in the Sitecore website from here. I have found that this example is far too complicated. I tried to create a Custom [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=1&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><ins datetime="2008-02-04T00:36:45+00:00"></ins><br />
In this blog I will describe how to create a very simple Custom Text field in Sitecore. I have based this off the example of a custom checkbox field that can be found in the Sitecore website from <a href="http://sdn5.sitecore.net/articles/api/creating%20a%20composite%20custom%20field.aspx" title="Custom Checkbox - Sitecore. " target="_blank">here</a>.</p>
<p>I have found that this example is far too complicated. I tried to create a Custom control by inheriting <code>Sitecore.Web.UI.HtmlControls.Control</code> but I could not get it working properly initially (I find the Custom check box control that Sitecore has used as an example is far too complicated)  I was sent a better example by sitecore and I will make the same custom control by inheriting this class in the near future when I find the time. However, because of current time constraints I had to take an alternative approach.</p>
<p>The control I have made is inheriting <code>Sitecore.Shell.Applications.ContentEditor.Text</code> directly and then overriding the HandleMessage event.</p>
<p>I needed to create a Custom Text field which behaves the same way as Sitecore&#8217;s Text field but I needed some extra menu items. Basically I needed to allow my authors to add some extra text Macron characters e.g. <b>Ā</b></p>
<p>Here is the Sitecore Field Type item I have created (this should be implemented following the Sitecore <a href="http://sdn5.sitecore.net/articles/api/creating%20a%20composite%20custom%20field.aspx" title="Sitecore custom check box. " target="_blank">example</a>) Base Template is Sitecore&gt;Templates&gt;System&gt;Templates&gt;Template Field Type:<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg" title="MacroText item"><img src="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg?w=450" alt="MacroText item" /></a></p>
<p>This is the Macron menu item I will be using as an example:<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg" title="Macron text menu item."><img src="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg?w=450" alt="Macron text menu item." /></a></p>
<p>This is the end result I am trying to achieve (A regular text box with extra drop down menu items in Authoring mode):<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg" title="Field."><img src="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg?w=450" alt="Field." /></a></p>
<p>Here is the Code <b>MacroText.cs</b>. As you may notice only the Clear field and the actual macron menu functions are currently working:<br />
Note: I also had to chuck a space where it says &#8216;&amp; #256;&#8217; between the &amp; and the #256; because otherwise this blog seems to keep converting it to &#8220;Ā&#8217; within the code!!</p>
<p>I have uploaded this code to another blog that actually retains the indentation <a href="http://richdman.spaces.live.com/blog/cns!AF561F88F8A43CB9!125.entry" title="code. " target="_blank">here</a></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Data;<br />
using System.Xml;<br />
using System.Web.UI;</p>
<p>namespace Datacom.FieldTypeExtensions<br />
{<br />
    class MacroText : Sitecore.Shell.Applications.ContentEditor.Text<br />
    {     </p>
<p>        #region Constructor<br />
        public MacroText()<br />
        {<br />
            this.Class = &#8220;scContentControl&#8221;;<br />
            base.Activation = true;<br />
        }<br />
        #endregion        </p>
<p>        #region Overrides</p>
<p>        public override void HandleMessage(Sitecore.Web.UI.Sheer.Message message)<br />
        {</p>
<p>            if (message["id"] == this.ID)<br />
            {<br />
                string messageText;<br />
                if ((messageText = message.Name) == null)<br />
                {<br />
                    return;<br />
                }</p>
<p>                switch (messageText)<br />
                {<br />
                    case &#8220;macrotext:copy&#8221; :<br />
                        break;<br />
                    case &#8220;macrotext:paste&#8221;:<br />
                        break;<br />
                    case &#8220;macrotext:clearfield&#8221;:<br />
                        this.Value = String.Empty;<br />
                        break;<br />
                    case &#8220;macrotext:capitalAMacro&#8221;:<br />
                        this.Value = this.Value + &#8220;&amp; #256;&#8221;;<br />
                        break;<br />
                }<br />
            }</p>
<p>            base.HandleMessage(message);</p>
<p>        }<br />
        #endregion<br />
    }<br />
}</p>
<p>Here is my Sitecore web.config entry (the name of my assembly is &#8216;Datacom.FieldTypeExtensions&#8217;, this can be edited via the properties of your .NET project as can be seen in next image below):</p>
<p>&lt;controlSources&gt;<br />
&lt;source mode=&#8221;on&#8221; namespace=&#8221;Datacom.FieldTypeExtensions&#8221;          assembly=&#8221;Datacom.FieldTypeExtensions&#8221; prefix=&#8221;fieldTypeExtension&#8221;/&gt;</p>
<p>My project structure:<br />
<a href="http://richdias.files.wordpress.com/2008/02/project.jpg" title=".NET project"><img src="http://richdias.files.wordpress.com/2008/02/project.thumbnail.jpg?w=450" alt=".NET project" /></a></p>
<p>Hopefully someone finds this helpful!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&amp;blog=2729043&amp;post=1&amp;subd=richdias&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg" medium="image">
			<media:title type="html">MacroText item</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg" medium="image">
			<media:title type="html">Macron text menu item.</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg" medium="image">
			<media:title type="html">Field.</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/project.thumbnail.jpg" medium="image">
			<media:title type="html">.NET project</media:title>
		</media:content>
	</item>
	</channel>
</rss>
