<?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/"
	>

<channel>
	<title>Aaron Blake&#039;s Blog &#187; ASP.net</title>
	<atom:link href="http://www.aaronblake.co.uk/blog/category/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aaronblake.co.uk/blog</link>
	<description>Think, share and grow.</description>
	<lastBuildDate>Sat, 28 May 2011 13:22:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Microsoft .NET Framework 4 Web Applications certification &#8211; Passed!</title>
		<link>http://www.aaronblake.co.uk/blog/2011/05/28/microsoft-net-framework-4-web-applications-certification-passed/</link>
		<comments>http://www.aaronblake.co.uk/blog/2011/05/28/microsoft-net-framework-4-web-applications-certification-passed/#comments</comments>
		<pubDate>Sat, 28 May 2011 13:00:12 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[microsoft certification]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=280</guid>
		<description><![CDATA[Yesterday I passed the Microsoft exam 70-515, and got my .NET Framework 4, Web Applications certification. Lots of revision paid off in the end.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I passed the Microsoft exam 70-515, and got my .NET Framework 4, Web Applications certification.</p>
<p>Lots of revision paid off in the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2011/05/28/microsoft-net-framework-4-web-applications-certification-passed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get ID of Sitecore Item using XSLT</title>
		<link>http://www.aaronblake.co.uk/blog/2010/06/12/get-id-of-sitecore-item-using-xslt/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/06/12/get-id-of-sitecore-item-using-xslt/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:45:20 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=260</guid>
		<description><![CDATA[How to get the id of a sitecore item in XSLT: OR]]></description>
			<content:encoded><![CDATA[<p>How to get the id of a sitecore item in XSLT:</p>
<pre class="brush:xml">
<sc:text field="@id"/>
</pre>
<p>OR</p>
<pre class="brush:xml">
<xsl:value-of select="sc:fld('@id',.)"/>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/06/12/get-id-of-sitecore-item-using-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore nav using XSLT</title>
		<link>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-nav-using-xslt/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-nav-using-xslt/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:43:19 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=258</guid>
		<description><![CDATA[How to create a multi level navigation menu from sitecore items: active]]></description>
			<content:encoded><![CDATA[<p>How to create a multi level navigation menu from sitecore items:</p>
<pre class="brush:xml">
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sc="http://www.sitecore.net/sc" xmlns:dot="http://www.sitecore.net/dot" exclude-result-prefixes="dot sc">

  <!-- output directives -->
  <xsl:output method="html" indent="no" encoding="UTF-8" />

  <!-- parameters -->
  <xsl:param name="lang" select="'en'"/>
  <xsl:param name="id" select="''"/>
  <xsl:param name="sc_item"/>
  <xsl:param name="sc_currentitem"/>

  <!-- entry point -->
  <xsl:template match="*">
    <xsl:apply-templates select="$sc_item" mode="main"/>
  </xsl:template>

  <!--==============================================================-->
  <!-- main                                                         -->
  <!--==============================================================-->
  <xsl:template match="*" mode="main">
<ul class="sub-navigation">
        <xsl:apply-templates select="ancestor-or-self::item[@template='home']" mode="menutree" >
            <xsl:with-param name="depth" select="0"/>
        </xsl:apply-templates>
    </ul>

  </xsl:template>

    <xsl:template match="item" mode="menutree">
        <xsl:param name="depth"/>
        <!-- only show level 2 and 3-->
        <xsl:if test="$depth &lt; 3">
            <xsl:for-each select="child::item">
<li>
                <xsl:choose>
                    <xsl:when test="count(descendant-or-self::item[@id = $sc_item/@id]) > 0">
                            <xsl:apply-templates select="." mode="recursive">
                                <xsl:with-param name="class">active</xsl:with-param>
                            </xsl:apply-templates>
                            <!-- check if the current item, or one of its descendants, is selected -->
                            <xsl:if test="count(descendant::item) > 0 and $depth &lt; 2">
<ul>
                                    <xsl:apply-templates select="." mode="menutree" >
                                        <xsl:with-param name="depth" select="$depth+1"/>
                                    </xsl:apply-templates>
                                </ul>

                            </xsl:if>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:apply-templates select="." mode="recursive"/>
                    </xsl:otherwise>
                </xsl:choose>
                  </li>

            </xsl:for-each>
        </xsl:if>
    </xsl:template>

    <xsl:template match="item" mode="recursive">
        <xsl:param name="class" />
            <sc:link select="." text="{sc:field('MenuTitle', .)}" class="{$class}"/>
    </xsl:template>

</xsl:stylesheet>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-nav-using-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore Exceptions TicketParseException</title>
		<link>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-exceptions-ticketparseexception/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-exceptions-ticketparseexception/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:36:50 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=254</guid>
		<description><![CDATA[Q: When I perform a logout (log in) I got this error: Server Error in &#8216;/&#8217; Application. 924D3DEEAC964880B38A9F4D4B664511^TestUser^123^123^20071011T161646 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Sitecore.Exceptions.TicketParseException: 924D3DEEAC964880B38A9F4D4B664511^akom^123^321^20071011T161646 &#8230; Why [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Q: </strong>When I perform a logout (log in) I got this error:</p>
<p>Server Error in &#8216;/&#8217; Application.</p>
<p>924D3DEEAC964880B38A9F4D4B664511^TestUser^123^123^20071011T161646</p>
<p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.<br />
Exception Details: Sitecore.Exceptions.TicketParseException: 924D3DEEAC964880B38A9F4D4B664511^akom^123^321^20071011T161646<br />
&#8230;</p>
<p>Why is this happening?</p>
<p><strong>A:</strong> These characters “^” and “|” can’t be used in the name of the user and the password.</p>
<p><strong>Reference:</strong><br />
<a href="http://sdn.sitecore.net/Scrapbook/Illegal%20characters%20in%20the%20name%20of%20the%20user%20and%20the%20password.aspx">http://sdn.sitecore.net/Scrapbook/Illegal%20characters%20in%20the%20name%20of%20the%20user%20and%20the%20password.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/06/12/sitecore-exceptions-ticketparseexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore Item Renamed Event does not provide item name before renaming.</title>
		<link>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-item-renamed-event-does-not-provide-item-name-before-renaming/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-item-renamed-event-does-not-provide-item-name-before-renaming/#comments</comments>
		<pubDate>Sat, 29 May 2010 22:28:33 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=251</guid>
		<description><![CDATA[According to Sitecore documentation the item:renamed event arguments should provide you with the result item and the item name before renaming. item:renamed 0 Item Result item 1 String Item name before renaming Unfortunately in practice the second value is actually the current item name, and not the previous name. This bug presents a massive problem [...]]]></description>
			<content:encoded><![CDATA[<p>According to Sitecore <a href="http://sdn.sitecore.net/Articles/API/Using%20Events/Handling%20Events.aspx">documentation</a> the item:renamed event arguments should provide you with the result item and the item name before renaming.</p>
<p>item:renamed<br />
0<br />
Item<br />
Result item</p>
<p>1<br />
String<br />
Item name before renaming</p>
<p>Unfortunately in practice the second value is actually the current item name, and not the previous name.</p>
<p>This bug presents a massive problem if you require the previous name.</p>
<p>Fortunately I found a way around this.<br />
By using the Sitecore history engine, you can work out what the previous name was.</p>
<p><strong>Solution:</strong></p>
<pre class="brush:csharp">
        protected void OnItemRename(object sender, EventArgs args)
        {
            var itm = Event.ExtractParameter(args, 0) as Sitecore.Data.Items.Item;

            if (itm == null)
            {
                return;
            }

            var history = itm.Database.Engines.HistoryEngine.GetHistory(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow.AddDays(1));

            if (history.Count < 1)
            {
                return;
            }

            var oldEntity = GetOldEntity(itm.ID.Guid, itm.Paths.Path, history);

            var oldName = GetOldName(oldEntity.ItemPath);
        }
</pre>
<pre class="brush:csharp">
        ///
<summary>
        /// Uses the history engine to retrieve the last entry with a different path from the target item.
        /// </summary>

        ///
<param name="itemId">
        /// The item id.
        /// </param>
        ///
<param name="itemPath">
        /// The item path.
        /// </param>
        ///
<param name="history">
        /// The history.
        /// </param>
        /// <returns>
        /// History Entity
        /// </returns>
        public static HistoryEntry GetOldEntity(Guid itemId, string itemPath, HistoryEntryCollection history)
        {
            var oldEntities = from h in history
                              orderby h.Created descending
                              where h.ItemId.Guid.Equals(itemId) &#038;&#038; (!h.ItemPath.Equals(itemPath))
                              select h;

            return oldEntities.Count() < 1 ? null : oldEntities.First();
        }

        ///
<summary>
        /// Gets the old item name
        /// </summary>

        ///
<param name="oldItemPath">
        /// The old item path.
        /// </param>
        /// <returns>
        /// The old item name
        /// </returns>
        public static string GetOldName(string oldItemPath)
        {
            return oldItemPath.Substring(
                (oldItemPath.LastIndexOf("/", StringComparison.CurrentCulture) + 1),
                (oldItemPath.Length - oldItemPath.LastIndexOf("/", StringComparison.CurrentCulture) - 1));
        }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-item-renamed-event-does-not-provide-item-name-before-renaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telerik RadGrid events not firing in Sitecore</title>
		<link>http://www.aaronblake.co.uk/blog/2010/05/29/telerik-radgrid-events-not-firing-in-sitecore/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/05/29/telerik-radgrid-events-not-firing-in-sitecore/#comments</comments>
		<pubDate>Sat, 29 May 2010 22:19:57 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=243</guid>
		<description><![CDATA[I recently had to use a Telerik RadGrid during the development of an admin page within a sitecore site. The error: Sitecore&#8217;s event handlers conflict with RadGrid, which causes sorting, filtering, editing and deleting to fail. I kept receiving a bank page every time an event fired, as if it lost the datasource. The solution: [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to use a Telerik RadGrid during the development of an admin page within a sitecore site.</p>
<p><strong>The error:</strong></p>
<p>Sitecore&#8217;s event handlers conflict with RadGrid, which causes sorting, filtering, editing and deleting to fail.<br />
I kept receiving a bank page every time an event fired, as if it lost the datasource.</p>
<p><strong>The solution:</strong></p>
<p>The solution to this problem is to exclude the controls from Sitecore&#8217;s event handlers.<br />
You can do this very easily by updating the following section in the Sitecore web.config:</p>
<pre class="brush:text">
  <!-- RENDERING -->
    <rendering>
      <typesThatShouldNotBeExpanded>
        <type>System.Web.UI.WebControls.Repeater</type>
        <type>System.Web.UI.WebControls.DataList</type>
        <type>System.Web.UI.WebControls.GridView</type>
        <type>Telerik.Web.UI.RadGrid</type>
      </typesThatShouldNotBeExpanded>
    </rendering>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/05/29/telerik-radgrid-events-not-firing-in-sitecore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore &#8211; CryptographicException file not found</title>
		<link>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-cryptographicexception-file-not-found/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-cryptographicexception-file-not-found/#comments</comments>
		<pubDate>Sat, 29 May 2010 22:18:08 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=241</guid>
		<description><![CDATA[After installing a new instance of Sitecore manually, I kept receiving the following error: CryptographicException file not found Server Error in &#8216;/&#8217; Application. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and [...]]]></description>
			<content:encoded><![CDATA[<p>After installing a new instance of Sitecore manually, I kept receiving the following error:</p>
<blockquote><p>
CryptographicException file not found</p>
<p>Server Error in &#8216;/&#8217; Application.<br />
The system cannot find the file specified. </p>
<p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.<br />
Exception Details: System.Security.Cryptography.CryptographicException: The system cannot find the file specified.<br />
Source Error:<br />
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p>
<p>Stack Trace:</p>
<p>[CryptographicException: The system cannot find the file specified.<br />
]<br />
   System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +7715070<br />
   System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters) +258<br />
   System.Security.Cryptography.DSA.FromXmlString(String xmlString) +501<br />
   Sitecore.Nexus.Licensing.NexusLicenseApi.(String xml, Guid instance) +124<br />
   Sitecore.Nexus.Licensing.NexusLicenseApi.GetSnapShot(Guid instance) +683<br />
   Sitecore.SecurityModel.License.LicenseManager.GetSnapshotData(Guid instance) +47<br />
   Sitecore.SecurityModel.License.LicenseManager.UpdateSnapshot() +70<br />
   Sitecore.SecurityModel.License.LicenseManager.Initialize() +8<br />
   Sitecore.Nexus.Web.HttpModule.Application_Start() +76<br />
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +435<br />
   System.Web.HttpApplication.InitModulesCommon() +65<br />
   System.Web.HttpApplication.InitModules() +43<br />
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729<br />
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298<br />
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107<br />
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289</p>
<p>Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
</p></blockquote>
<p>This random error is actually being caused by the IIS application pool not being configured to run using a non-standard user account Identity.</p>
<p><strong>The solution:</strong></p>
<p>To solve the problem, set Load User Profile to true for the website application pool in IIS.</p>
<ol>
<li>Open IIS Manager</li>
<li>Click on Application Pools on the right.</li>
<li>Right Click on the application pool for your web site and select &#8220;Advanced Settings&#8221;</li>
<li>In the Process Model section, set Load User Profile to true.</li>
</ol>
<p><strong>References:</strong></p>
<p><a href="http://www.realnero.info/2010/04/sitecore-cryptographicexception-file.html">http://www.realnero.info/2010/04/sitecore-cryptographicexception-file.html</a><br />
<a href="http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog.aspx">http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/05/29/sitecore-cryptographicexception-file-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate Sitecore Item Programmatically</title>
		<link>http://www.aaronblake.co.uk/blog/2010/05/29/validate-sitecore-item-programmatically/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/05/29/validate-sitecore-item-programmatically/#comments</comments>
		<pubDate>Sat, 29 May 2010 22:12:54 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[validate sitecore item fields]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=239</guid>
		<description><![CDATA[I was developing an event handler that needed to check if the fields in a Sitecore item were valid before continuing with the event. I thought Sitecore items might have a property such as: item.Validation.IsValid But this isn&#8217;t the case. To check if an item is valid, I created a custom function called ValidateItemFields that [...]]]></description>
			<content:encoded><![CDATA[<p>I was developing an event handler that needed to check if the fields in a Sitecore item were valid before continuing with the event.<br />
I thought Sitecore items might have a property such as:<br />
<code>item.Validation.IsValid</code></p>
<p>But this isn&#8217;t the case. To check if an item is valid, I created a custom function called ValidateItemFields that works in an item event handler.</p>
<p>Solution:</p>
<pre class="brush:csharp">
        ///
<summary>
        /// Validates all fields in item.
        /// </summary>

        ///
<param name="item">
        /// The item to be validated.
        /// </param>
        /// <returns>
        /// True if all fields are valid.
        /// </returns>
        private static bool ValidateItemFields(Item item)
        {
            if (((item != null) &#038;&#038; !item.Paths.IsMasterPart) &#038;&#038; !StandardValuesManager.IsStandardValuesHolder(item))
            {
                item.Fields.ReadAll();
                item.Fields.Sort();
                foreach (Field field in item.Fields)
                {
                    if (!string.IsNullOrEmpty(field.Validation) &#038;&#038; !Regex.IsMatch(field.Value, field.Validation, RegexOptions.Singleline))
                    {
                        return false;
                    }
                }

                var formValue = WebUtil.GetFormValue("scValidatorsKey");
                if (!string.IsNullOrEmpty(formValue))
                {
                    var validators = ValidatorManager.GetValidators(ValidatorsMode.ValidatorBar, formValue);
                    var options = new ValidatorOptions(true);
                    ValidatorManager.Validate(validators, options);
                    var valid = ValidatorResult.Valid;
                    foreach (BaseValidator validator in validators)
                    {
                        var result = validator.Result;
                        if (validator.ItemUri != null)
                        {
                            var item1 = Client.ContentDatabase.GetItem(validator.ItemUri.ToDataUri());
                            if (((item1 != null) &#038;&#038; StandardValuesManager.IsStandardValuesHolder(item1)) &#038;&#038; (result > ValidatorResult.CriticalError))
                            {
                                result = ValidatorResult.CriticalError;
                            }
                        }

                        if (result > valid)
                        {
                            valid = validator.Result;
                        }

                        if (validator.IsEvaluating &#038;&#038; (validator.MaxValidatorResult >= ValidatorResult.CriticalError))
                        {
                            return false;
                        }
                    }

                    switch (valid)
                    {
                        case ValidatorResult.CriticalError:
                            return false;

                        case ValidatorResult.FatalError:
                            return false;
                    }
                }
            }

            return true;
        }
</pre>
<p>Example:</p>
<pre class="brush:csharp">
///
<summary>
        /// On Item Moving event handler for ImportArticle Items
        /// </summary>

        ///
<param name="sender">
        /// The sender object.
        /// </param>
        ///
<param name="args">
        /// The args.
        /// 0 - Item being moved
        /// 1 - Move destination
        /// </param>
        public void OnItemMoving(object sender, EventArgs args)
        {
            var item = Event.ExtractParameter(args, 0) as Item;
            if (item == null)
            {
                return;
            }

            // Check item type is ImportArticle
            if (!item.Template.Name.Equals(TemplateName))
            {
                return;
            }

            // If ancestor is a child of Content Node, then return
            if (item.Axes.GetAncestors().Any(ancestor => ancestor.Paths.Path.Equals(ContentItemPath)))
            {
                return;
            }

            // If item is valid, return
            if (ValidateItemFields(item))
            {
                return;
            }

            SheerResponse.Alert(ErrorMessage, new string[0]);
            ((SitecoreEventArgs)args).Result.Cancel = true;
        }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/05/29/validate-sitecore-item-programmatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Duplicate Namespace Problem</title>
		<link>http://www.aaronblake.co.uk/blog/2010/02/27/duplicate-namespace-problem/</link>
		<comments>http://www.aaronblake.co.uk/blog/2010/02/27/duplicate-namespace-problem/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 12:58:26 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=232</guid>
		<description><![CDATA[Today I cam across an annoying Namespace issue, which I spent ages trying to solve. If you have a namespace which has the same name as another namespace but at a different level, .net won&#8217;t know which namespace to use, and will through an error. This is also true for classes as well. Example: namespace [...]]]></description>
			<content:encoded><![CDATA[<p>Today I cam across an annoying Namespace issue, which I spent ages trying to solve.</p>
<p>If you have a namespace which has the same name as another namespace but at a different level, .net won&#8217;t know which namespace to use, and will through an error.</p>
<p>This is also true for classes as well.</p>
<p>Example:<br />
<code><br />
namespace Zone.Section<br />
{<br />
    public class ShowZone{}<br />
}<br />
</code><br />
<code><br />
using Zone.Section</p>
<p>namespace Website.Zone<br />
{</p>
<p>    public class Page<br />
    {<br />
        void Load()<br />
        {<br />
            Zone.Section.ShowZone();<br />
        }</p>
<p>    }</p>
<p>}<br />
</code><br />
Now the example above will not compile, because .net can only see the Zone for Website.Zone, and not Zone.Section.</p>
<p>This problem usually occurs if you haven&#8217;t organised your namespaces properly, or is you have inherited code form various sources.</p>
<p>The solution</p>
<p>To get this code to work, you need to use the global prefix, and define the &#8220;using&#8221; (or Imports in vb.net) within the namespace.</p>
<p>For example:<br />
<code><br />
using Zone.Section</p>
<p>namespace Website.Zone<br />
{<br />
    using Zone = global::Zone;</p>
<p>    public class Page<br />
    {<br />
        void Load()<br />
        {<br />
            Zone.Section.ShowZone();<br />
        }</p>
<p>    }</p>
<p>}</code></p>
<p>OR<br />
<code><br />
namespace Website.Zone<br />
{</p>
<p>    public class Page<br />
    {<br />
        void Load()<br />
        {<br />
            global::Zone.Section.ShowZone();<br />
        }</p>
<p>    }</p>
<p>}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2010/02/27/duplicate-namespace-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuyahoga &#8211; How to publish from source.</title>
		<link>http://www.aaronblake.co.uk/blog/2009/10/01/cuyahoga-how-to-publish-from-source/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/10/01/cuyahoga-how-to-publish-from-source/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 08:09:49 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[Cuyahoga]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=171</guid>
		<description><![CDATA[Introduction Publishing a Cuyahoga site from the source code using visual studio will not work using the in built publishing tools alone. You need to take a few additional steps. Please note I used Visual Studio 2008 to create this tutorial. The steps may differ slightly in different versions. 1. Rebuild solution Rebuild the entire [...]]]></description>
			<content:encoded><![CDATA[<p>Introduction</p>
<p>Publishing a Cuyahoga site from the source code using visual studio will not work using the in built publishing tools alone. You need to take a few additional steps.</p>
<p>Please note I used Visual Studio 2008 to create this tutorial. The steps may differ slightly in different versions.</p>
<p>1. Rebuild solution</p>
<p>Rebuild the entire solution to make sure everything is up to date.<br />
Also make sure all your modules have been added to the Modules folder of the Web project successfully.</p>
<p>2. Publish Cuyahoga.Web project</p>
<p>Publish the web project by selecting from the menu:</p>
<ul>
<li>Select the Cuyahoga.Web project in the solution explorer.</li>
<li>Select Build from the menu bar.</li>
<li>Select Publish Cuyahoga.Web.</li>
<li>In the Publish dialog:
<ul>
<li>Select a target location for the published site.</li>
<li>Select &#8220;Delete all existing files prior to publish&#8221; for a clean install.</li>
<li>Select &#8220;Only files needed to run this application.&#8221;</li>
<li>Select Publish button.</li>
</ul>
</li>
</ul>
<p>3. Add module files to published site.</p>
<p>You need to copy the modules folder from you Cuyahoga.Web project, over to your published site manually.<br />
If there is nothing in your Cuyahoga.Web modules folder, you probably didn&#8217;t rebuild the solution properly, so go back and repeat step 1.</p>
<p>4. Deploy</p>
<p>Your site is now fully compiled and ready to deploy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/10/01/cuyahoga-how-to-publish-from-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuyahoga: How to change the admin template</title>
		<link>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-change-the-admin-template/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-change-the-admin-template/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 10:49:57 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[Cuyahoga]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=162</guid>
		<description><![CDATA[Introduction It didn&#8217;t seem obvious to me at first how to change the appearance of the Cuyahoga admin template, so I thought I&#8217;d create a simple guide to point you in the right direction. Web Config The web config within the admin folder of your Cuyahoga site is where you can find the template settings. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>It didn&#8217;t seem obvious to me at first how to change the appearance of the Cuyahoga admin template, so I thought I&#8217;d create a simple guide to point you in the right direction.</p>
<p><strong>Web Config</strong></p>
<div id="attachment_177" class="wp-caption alignnone" style="width: 743px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AdminWebConfig1.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AdminWebConfig1.JPG" alt="Cuyahoga Admin Web Config" title="c_AdminWebConfig" width="733" height="882" class="size-full wp-image-177" /></a><p class="wp-caption-text">Cuyahoga Admin Web Config</p></div>
<p>The web config within the admin folder of your Cuyahoga site is where you can find the template settings.<br />
/Admin/Web.config</p>
<pre class="brush:xml">
&lt;appSettings&gt; &lt;add key=&quot;TemplateDir&quot; value=&quot;~/Admin/Controls/&quot; /&gt; &lt;add
    key=&quot;DefaultTemplate&quot; value=&quot;AdminTemplate.ascx&quot; /&gt; &lt;add key=&quot;DefaultCss&quot;
    value=&quot;~/Admin/Css/Admin.css&quot; /&gt; &lt;add key=&quot;DefaultTitle&quot; value=&quot;Cuyahoga Site
    Administration&quot; /&gt; &lt;/appSettings&gt;
</pre>
<p>Template directory</p>
<p>Set this to the directory that contains the template you want to use for the admin section.</p>
<p>Default template</p>
<p>Set this to the template file you wish to use as the default admin template. Note that this file must reside within the template directory.</p>
<p>Default CSS</p>
<p>Set the default CSS file to be used by the template.</p>
<p>Default Title</p>
<p>Set the default page title use for the admin section.</p>
<p>Conclusion</p>
<p>Its probably best to make a copy of the standard AdminTemplate.ascx template, then edit this to fix your design if your new to using templates in Cuyahoga.</p>
<p>But the system is flexible enough to allow you to create your own templates from scratch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-change-the-admin-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuyahoga: How to create a module tutorial</title>
		<link>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-create-a-module-tutorial/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-create-a-module-tutorial/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 10:05:13 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[Cuyahoga]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=149</guid>
		<description><![CDATA[Introduction This tutorial shows you how to create a simple module for the open source CMS Cuyahoga. Visual studio 2008 was used to create this example, but it should also work in Visual Studio 2005 with the SP1 upgrade. Supporting documents: Cuyahoga.Modules.Sample Files VB.net PDF tutorial 1. Download Cuyahoga source You can download the latest [...]]]></description>
			<content:encoded><![CDATA[<p>Introduction</p>
<p>This tutorial shows you how to create a simple module for the open source CMS Cuyahoga.<br />
Visual studio 2008 was used to create this example, but it should also work in Visual Studio 2005 with the SP1 upgrade.</p>
<p>Supporting documents:<br />
<a href='http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/Cuyahoga.Modules.Sample.zip'>Cuyahoga.Modules.Sample Files VB.net</a><br />
<a href='http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/Cuyahoga_How_to_create_a_module_tutorial.pdf'>PDF tutorial</a></p>
<p>1. Download Cuyahoga source</p>
<p>You can download the latest version here:<br />
<a href="http://sourceforge.net/projects/cuyahoga/files/">http://sourceforge.net/projects/cuyahoga/files/</a></p>
<p>2. Install and run site</p>
<p>Set up a sample site or use your current Cuyahoga site.</p>
<p>3. Open the Cuyahoga solution in visual studio.</p>
<p>4. Add a new web application project to the solution.</p>
<p>Name the project using the following standard: Cuyahoga.Modules.<add module name here><br />
<div id="attachment_184" class="wp-caption alignnone" style="width: 687px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddProject1.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddProject1.JPG" alt="Add Project" title="Add Project" width="677" height="684" class="size-full wp-image-184" /></a><p class="wp-caption-text">Add Project</p></div><br />
<div id="attachment_180" class="wp-caption alignnone" style="width: 693px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddWebProject.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddWebProject.JPG" alt="Add Web Project" title="c_AddWebProject" width="683" height="447" class="size-full wp-image-180" /></a><p class="wp-caption-text">Add Web Project</p></div><br />
5. Delete all files currently in the project.</p>
<p>6. Add directories</p>
<p>Add the following directories to your project:<br />
Web<br />
Install<br />
Install/Database<br />
Install/Database/mssql2000<br />
<div id="attachment_186" class="wp-caption alignnone" style="width: 239px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddFolders.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddFolders.JPG" alt="Add Folders" title="Add Folders" width="229" height="384" class="size-full wp-image-186" /></a><p class="wp-caption-text">Add Folders</p></div></p>
<p>7. Add post build events.</p>
<p>Edit and then add the following post build events to your project properties:</p>
<pre class="brush:text">
xcopy /s /y "$(ProjectDir)"Web\*.as?x "$(SolutionDir)"Web\Modules\Sample\
xcopy /s /y "$(ProjectDir)"Install\Database\*.sql "$(SolutionDir)"Web\Modules\Sample\Install\Database\
xcopy /s /y "$(TargetDir)"Cuyahoga.Modules.Sample*.dll "$(SolutionDir)"Web\bin\
</pre>
<p>You can find the post build events window by going to:<br />
Open Project Properties<br />
<div id="attachment_187" class="wp-caption alignnone" style="width: 588px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_GotoProjectProperties.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_GotoProjectProperties.JPG" alt="Go to Project Properties" title="Go to Project Properties" width="578" height="845" class="size-full wp-image-187" /></a><p class="wp-caption-text">Go to Project Properties</p></div><br />
Click the Compile tab<br />
<div id="attachment_188" class="wp-caption alignnone" style="width: 808px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_Properties.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_Properties.JPG" alt="Properties Compile" title="Properties Compile" width="798" height="780" class="size-full wp-image-188" /></a><p class="wp-caption-text">Properties Compile</p></div><br />
Click the build events button<br />
<div id="attachment_189" class="wp-caption alignnone" style="width: 808px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_BuildEvents.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_BuildEvents.JPG" alt="Build Events" title="Build Events" width="798" height="778" class="size-full wp-image-189" /></a><p class="wp-caption-text">Build Events</p></div></p>
<p>If your using a different version of visual studio, the build events window might be a tab in the project properties window.</p>
<p>8. Add project references.</p>
<p>You will need to add at least the following two project references:<br />
Cuyahoga.Core<br />
Cuyahoga.Web</p>
<p>To add a project reference, right click on the project in the solution explorer and the select add reference.<br />
<div id="attachment_190" class="wp-caption alignnone" style="width: 486px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddRef.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddRef.JPG" alt="Add project reference" title="Add project reference" width="476" height="844" class="size-full wp-image-190" /></a><p class="wp-caption-text">Add project reference</p></div><br />
In the add reference dialogue, navigate to the project tab and select the project you wish to add.<br />
<div id="attachment_191" class="wp-caption alignnone" style="width: 477px"><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddReffDialog.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_AddReffDialog.JPG" alt="Add reference" title="Add reference" width="467" height="390" class="size-full wp-image-191" /></a><p class="wp-caption-text">Add reference</p></div></p>
<p>9. Create the module controller.</p>
<p>Create a new class in the root of your module project called <add module name here>Module.<br />
For example &#8211; SampleModule<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_SampleModule.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_SampleModule.JPG" alt="Sample Module" title="Sample Module" width="701" height="478" class="alignnone size-full wp-image-193" /></a><br />
Add the following code to your class, remember to change SampleModule for the name of your module.</p>
<p>C#</p>
<pre class="brush:csharp">
using System;
using Cuyahoga.Core.Domain;

Namespace Cuyahoga.Modules.Sample
{
    ///
<summary>
    /// Controller class of the module
    /// </summary>

    class SampleModule: ModuleBase
    {
        ///
<summary>
        /// Controller constructor
        /// </summary>

        Public SampleModule()
        {
            //nothing in the constructor for this basic sample
        }
    }
}
</pre>
<p>VB.net</p>
<pre class="brush:vbnet">
Imports System
Imports Cuyahoga.Core.Domain

'''
<summary>
''' Controller class of the module
''' </summary>

Class SampleModule
    Inherits ModuleBase
    '''
<summary>
    ''' Controller constructor
    ''' </summary>

    Public Sub New()
        'nothing in the constructor for this basic sample
    End Sub
End Class
</pre>
<p>10. Create a user control.</p>
<p>Add a new user control to your web folder, for example:</p>
<pre class="brush:plain">
&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Sample.ascx.cs&quot;
    Inherits=&quot;Cuyahoga.Modules.Sample.Web.Sample&quot; %&gt;
Hello World!
</pre>
<p><a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_SampleASCX.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_SampleASCX.JPG" alt="Sample ASCX" title="Sample ASCX" width="730" height="674" class="alignnone size-full wp-image-194" /></a><br />
The code behind needs to inherit the BaseModule Control.<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_SampleASCXVB.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_SampleASCXVB.JPG" alt="Sample ASCX VB" title="Sample ASCX VB" width="851" height="625" class="alignnone size-full wp-image-195" /></a></p>
<p>For example:</p>
<p>C#</p>
<pre class="brush:csharp">
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Cuyahoga.Web.UI;

Namespace Cuyahoga.Modules.Sample.Web
{
    ///
<summary>
    /// Sample control displayng in Cuyahoga the "Hello World" text
    /// </summary>

    public partial class Sample : BaseModuleControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //for this basic sample we do not need to do anything
        }
    }
}
</pre>
<p>VB.net</p>
<pre class="brush:vbnet">
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Imports Cuyahoga.Web.UI

Namespace Web
    '''
<summary>
    ''' Sample control displayng in Cuyahoga the "Hello World" text
    ''' </summary>

    Partial Public Class Sample
        Inherits BaseModuleControl
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            'for this basic sample we do not need to do anything
        End Sub
    End Class
End Namespace
</pre>
<p>11. Create the SQL installation scripts.</p>
<p>In the Install/Database/mssql2000 folder you need to add 3 files to take advantage of the auto install and uninstall features.</p>
<p>Version File<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_VersionSQL.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_VersionSQL.JPG" alt="VersionSQL" title="VersionSQL" width="799" height="485" class="alignnone size-full wp-image-196" /></a><br />
For example if your module is at version 1.0.0, you need to add a file called 1.0.0.sql with the following code:</p>
<pre class="brush:sql">
UPDATE cuyahoga_version SET major = 1, minor = 0, patch = 0 WHERE assembly = 'Cuyahoga.Modules.Sample'
go
</pre>
<p>install.sql<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_installSQL.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_installSQL.JPG" alt="installSQL" title="installSQL" width="911" height="483" class="alignnone size-full wp-image-197" /></a><br />
The install.sql file will contain all the tables and stored procedures that need to be installed in the database to run your module, as well as update some of the CMS tables to identify your module.</p>
<p>For example:</p>
<pre class="brush:sql">
/*
 *  Table data
 */
--Install the Sample module for Cuyahoga in SQL Server

INSERT INTO cuyahoga_moduletype ([name], assemblyname, classname, path, editpath, inserttimestamp, updatetimestamp)
VALUES ('Sample', 'Cuyahoga.Modules.Sample', 'Cuyahoga.Modules.Sample.SampleModule', 'Modules/Sample/Sample.ascx', NULL, getdate(), getdate())
GO

INSERT INTO cuyahoga_version (assembly, major, minor, patch)
VALUES ('Cuyahoga.Modules.Sample', 1, 5, 0)
GO
</pre>
<p>uninstall.sql<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_UninstallSQL.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_UninstallSQL.JPG" alt="UninstallSQL" title="UninstallSQL" width="911" height="483" class="alignnone size-full wp-image-198" /></a><br />
The uninstall.sql file will contain instructions to delete the tables, stored procedures and other records installed by the install.sql file.</p>
<p>For example:</p>
<pre class="brush:sql">
--Uninstall the Sample module in Cuyahoga for SQL Server

DELETE FROM cuyahoga_version WHERE assembly = 'Cuyahoga.Modules.Sample'
go

DELETE FROM cuyahoga_moduletype
WHERE assemblyname = 'Cuyahoga.Modules.Sample'
go
</pre>
<p>12. Rebuild entire solution and run.<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_Rebuild.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/C_Rebuild.JPG" alt="Rebuild" title="Rebuild" width="685" height="737" class="alignnone size-full wp-image-199" /></a><br />
Run the site and login as admin.<br />
Navigate to the modules page and you should now see your module in the table.</p>
<p>Click install and if everything is fine it should be installed and you can now add that modules to sections of the site.</p>
<p>Troubleshooting</p>
<p>Namespace problems.</p>
<p>You might come across a problem when you try to install the module which throws the following error:</p>
<p>An error occured: Loading failed for Sample.Could not find module: Cuyahoga.Modules.Sample.SampleModule, Cuyahoga.Modules.Sample</p>
<p>This is caused by some of the namespaces in your module not being compiled correctly.<br />
I found out that Visual studio sometimes adds the default namespace to your class in addition to whatever namespace you declare.<br />
So if you used Namespace Cuyahoga.Modules.Sample.Web in your code, this will actually come out as Namespace Cuyahoga.Modules.Sample.Cuyahoga.Modules.Sample.Web.<br />
To fix this remove the default namespace from your class. So the example I provided before will now simply be: Namespace Web</p>
<p>Install Scripts</p>
<p>In order for the install scripts to work, they need to have the right file name and be places in the correct folder structure defined in the tutorial.<br />
Its recommended to have all three files for this feature to work smoothly.</p>
<p>Cannot see web form or user control source files in Visual Studio.<br />
<a href="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_ShowAllFiles.JPG"><img src="http://www.aaronblake.co.uk/blog/wp-content/uploads/2009/09/c_ShowAllFiles.JPG" alt="ShowAllFiles" title="ShowAllFiles" width="468" height="681" class="alignnone size-full wp-image-200" /></a><br />
For some reason, Visual Studio will sometimes hide certain files and folders. To see all files in the project folder go to PROJECT in the main menu and select SHOW ALL FILES.</p>
<p>Further reading:</p>
<p><a href="http://www.paolocorti.net/2007/04/30/cuyahoga-hello-world-sample-module-tutorial/">http://www.paolocorti.net/2007/04/30/cuyahoga-hello-world-sample-module-tutorial/</a><br />
<a href="http://www.cuyahoga-project.org/home/developers.aspx">http://www.cuyahoga-project.org/home/developers.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/09/30/cuyahoga-how-to-create-a-module-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to add web user controls to a class library project</title>
		<link>http://www.aaronblake.co.uk/blog/2009/09/28/how-to-add-web-user-controls-to-a-class-library-project/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/09/28/how-to-add-web-user-controls-to-a-class-library-project/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 11:38:26 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=142</guid>
		<description><![CDATA[Introduction By default you are unable to add web forms or user controls to a Class Library project. This guide will tell you how to get around this. IMPORTANT &#8211; Backup your project file before you make any amends to it, just in case something goes wrong. Step 1 &#8211; Open class library project file [...]]]></description>
			<content:encoded><![CDATA[<p>Introduction</p>
<p>By default you are unable to add web forms or user controls to a Class Library project. This guide will tell you how to get around this.</p>
<p>IMPORTANT &#8211; Backup your project file before you make any amends to it, just in case something goes wrong.</p>
<p>Step 1 &#8211; Open class library project file in a text editor.</p>
<p>The project file is usually in the root folder and has a file extension of .vbproj or .csproj</p>
<p>Step 2 &#8211; Add or replace the <ProjectTypeGuids> tag</p>
<p>Add or replace the <ProjectTypeGuids> tag with the following:</p>
<pre class="brush:xml"><ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids></pre>
<p>This tag should be underneath the <ProjectGuid> tag, which is within the <PropertyGroup> tag.</p>
<p>Example:</p>
<pre class="brush:xml">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{42FC0FAF-C05B-4C16-AB8A-3F4698F910D8}</ProjectGuid>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <RootNamespace>Cuyahoga.Modules.Test</RootNamespace>
    <AssemblyName>Cuyahoga.Modules.Test</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>WebControl</MyType>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <OptionExplicit>On</OptionExplicit>
    <OptionCompare>Binary</OptionCompare>
    <OptionStrict>Off</OptionStrict>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Cuyahoga.Modules.Test.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Cuyahoga.Modules.Test.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Management" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Linq" />
    <Import Include="System.Xml.Linq" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Class1.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
</pre>
<p>Step 3 &#8211; Save file and open project up in visual studio.</p>
<p>Conclusion</p>
<p>You should now be able to add web forms and user controls from the solution explorer within visual studio.</p>
<p>Further reading:<br />
<a href="http://haacked.com/archive/2006/02/07/AddingWebUserControlToAClassLibraryInVS.NET2005.aspx">http://haacked.com/archive/2006/02/07/AddingWebUserControlToAClassLibraryInVS.NET2005.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/09/28/how-to-add-web-user-controls-to-a-class-library-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug fix &#8211; Application restarts on directory delete in ASP.net</title>
		<link>http://www.aaronblake.co.uk/blog/2009/09/28/bug-fix-application-restarts-on-directory-delete-in-asp-net/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/09/28/bug-fix-application-restarts-on-directory-delete-in-asp-net/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 09:12:01 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=140</guid>
		<description><![CDATA[Introduction If a directory within an ASP.net website is deleted while the site is running, this causes the whole site to reboot, loosing any session data and logging out users. This quick tutorial will show you a quick fix that can be run in your global.asax to prevent this from happening. Step 1 &#8211; Define [...]]]></description>
			<content:encoded><![CDATA[<p>Introduction</p>
<p>If a directory within an ASP.net website is deleted while the site is running, this causes the whole site to reboot, loosing any session data and logging out users.</p>
<p>This quick tutorial will show you a quick fix that can be run in your global.asax to prevent this from happening.</p>
<p>Step 1 &#8211; Define the bug fix method</p>
<p>Define the following method somewhere in your application (easiest is within the global.asax file, but you can place it anywhere else that&#8217;s more convenient).</p>
<p>C#</p>
<pre class="brush:csharp">
private void FixAppDomainRestartWhenTouchingFiles()
{
if (CurrentTrustLevel == AspNetHostingPermissionLevel.Unrestricted)
{
// From: http://forums.asp.net/p/1310976/2581558.aspx
// FIX disable AppDomain restart when deleting subdirectory
// This code will turn off monitoring from the root website directory.
// Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.
PropertyInfo p = typeof(HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
object o = p.GetValue(null, null);
FieldInfo f = o.GetType().GetField("_dirMonSubdirs", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase);
object monitor = f.GetValue(o);
MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", BindingFlags.Instance | BindingFlags.NonPublic);
m.Invoke(monitor, new object[] { });
}
}
</pre>
<p>VB.net</p>
<pre class="brush:vbnet">
        Private Sub FixAppDomainRestartWhenTouchingFiles()
    If CurrentTrustLevel = AspNetHostingPermissionLevel.Unrestricted Then
        ' From: http://forums.asp.net/p/1310976/2581558.aspx
        ' FIX disable AppDomain restart when deleting subdirectory
        ' This code will turn off monitoring from the root website directory.
        ' Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.
        Dim p As PropertyInfo = GetType(HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic Or BindingFlags.[Public] Or BindingFlags.[Static])
        Dim o As Object = p.GetValue(Nothing, Nothing)
        Dim f As FieldInfo = o.[GetType]().GetField("_dirMonSubdirs", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.IgnoreCase)
        Dim monitor As Object = f.GetValue(o)
        Dim m As MethodInfo = monitor.[GetType]().GetMethod("StopMonitoring", BindingFlags.Instance Or BindingFlags.NonPublic)
        m.Invoke(monitor, New Object() {})
    End If
End Sub
</pre>
<p>Step 2 &#8211; Create Global.asax file in root of application.</p>
<p>If you don&#8217;t already have a global.asax file, you need to create one in the root of your application.</p>
<p>Step 3 &#8211; Run method in Application Start event of global.asax</p>
<p>C#</p>
<pre class="brush:csharp">
protected void Application_Start(Object sender, EventArgs e)
{
// Misc
FixAppDomainRestartWhenTouchingFiles();
}
</pre>
<p>VB.net</p>
<pre class="brush:vbnet">
Protected Sub Application_Start(ByVal sender As [Object], ByVal e As EventArgs)
' Misc
FixAppDomainRestartWhenTouchingFiles()
End Sub
</pre>
<p>Conclusion</p>
<p>This should fix the bug and prevent the ASP.net web site from restarting when a directory is deleted.</p>
<p>Further reading:<br />
<a href="http://forums.asp.net/p/1310976/2581558.aspx">http://forums.asp.net/p/1310976/2581558.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/09/28/bug-fix-application-restarts-on-directory-delete-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Precompiling ASP.net Web Site Projects in Visual Studio 2008</title>
		<link>http://www.aaronblake.co.uk/blog/2009/09/07/precompiling-asp-net-web-site-projects-in-visual-studio-2008/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/09/07/precompiling-asp-net-web-site-projects-in-visual-studio-2008/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 08:49:36 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=136</guid>
		<description><![CDATA[Introduction This tutorial will show you how to precompile an ASP.net Web Site Project in Visual Studio 2008. ASP.net currently has 3 different project models: Web Site Projects Web Application Projects MVC Projects Unlike Web Application and MVC projects, Web Site Projects do not need to be precompiled before they can be deployed on the [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This tutorial will show you how to precompile an ASP.net Web Site Project in Visual Studio 2008.</p>
<p>ASP.net currently has 3 different project models:</p>
<ol>
<li>Web Site Projects</li>
<li>Web Application Projects</li>
<li>MVC Projects</li>
</ol>
<p>Unlike Web Application and MVC projects, Web Site Projects do not need to be precompiled before they can be deployed on the web server. ASP.net dynamically compiles the site on Application start which means websites can be deployed quicker. The disadvantage is the user will experience delays every time the site needs to recompile on the server.</p>
<p>To overcome this problem, you can precompile a Web Site Project in Visual Studio 2005 upwards (excluding Visual Web Developer) before you upload it to the web server.</p>
<h2>Steps</h2>
<ol>
<li>Open or create a new website project in Visual Studio.</li>
<li>Go to Build > Publish Web Site</li>
<li>In the Target Location text box, enter where you would like to save the precompiled site.
</li>
<li>Leave the default values how they are, unless you wish to customise the build.
</li>
<li>Press OK.
</li>
<li>Visual Studio will build and save the entire pre-compiled website in the location you selected.
</li>
<li>Simply upload this to your web server as you would normally do.</li>
</ol>
<h2>Notes</h2>
<p>Warning: Make sure you delete the App Code folder on your web server if one already exists. If you have a class file in the App Code folder that has the same class as one on a precompiled site, you will get an error as both will be referenced in the project.</p>
<h2>Further reading</h2>
<p>For more information, please see:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms227972.aspx">How to: Precompile ASP.NET Web Sites</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/09/07/precompiling-asp-net-web-site-projects-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS Site Archiving</title>
		<link>http://www.aaronblake.co.uk/blog/2009/06/15/iis-site-archiving/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/06/15/iis-site-archiving/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 14:39:11 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=116</guid>
		<description><![CDATA[Introduction When sites have expired or are no longer in use, its best to back them up and delete them from IIS, to keep the server tidy, and prevent unwanted access. This tutorial explains how to archive a website, by saving the settings in an xml file (configuration file), the deleting the site from IIS. [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<div>When sites have expired or are no longer in use, its best to back them up and delete them from IIS, to keep the server tidy, and prevent unwanted access.</div>
<div>
</div>
<div>This tutorial explains how to archive a website, by saving the settings in an xml file (configuration file), the deleting the site from IIS.</div>
<h2>1. Open IIS</h2>
<div>You can open IIS on your server by going to:</div>
<div>
<ol>
<li>Control Panel</li>
<li>Administative Tools</li>
<li>Internet Information Services (IIS) Manager</li>
</ol>
</div>
<div>
</div>
<div>
</div>
<h2>2. Save configuration file</h2>
<div>To save the configuration file, open IIS.</div>
<div>
<ul>
<li>Expand the websites section and select the website you want to archive.</li>
<li>Right click on the website, then from the menu choose All Tasks, then save configuration to file.</li>
<li>You will be presented with a new window. In the file name textbox give the confiration file a meaningful name (such as the project codes or url), then select the path you wish to save the file, then save.</li>
</ul>
</div>
<div>
</div>
<h2>3. Delete website</h2>
<div>To delete the website from IIS.</div>
<div>
<ul>
<li>Right click on the website and the choose delete.</li>
</ul>
<div>
</div>
</div>
<div>Note &#8211; the option to delete will not be available if you have any property windows still open.</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/06/15/iis-site-archiving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX Server Side Custom Validation ASP.net 2.0</title>
		<link>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-server-side-custom-validation-aspnet-20/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-server-side-custom-validation-aspnet-20/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 15:54:39 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=112</guid>
		<description><![CDATA[Introduction This tutorial will cover how to use the ServerSideValidationExtender to enable custom validator controls to work client side without post-back using AJAX. By default, custom validator controls do not work client side, even if within an AJAX update panel. To get these to work, we need to use a new control called the ServerSideValidationExtender. [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<div>This tutorial will cover how to use the ServerSideValidationExtender to enable custom validator controls to work client side without post-back using AJAX.</div>
<div>By default, custom validator controls do not work client side, even if within an AJAX update panel.<br />
To get these to work, we need to use a new control called the ServerSideValidationExtender.</div>
<h2>Requirements</h2>
<ul>
<li>Visual Studio 2005 or higher.
  </li>
<li>ASP.net AJAX Extensions installed on the development machine.<br />
<a href="http://www.asp.net/ajax/downloads/"<br />
 style="color: rgb(85, 26, 139);">http://www.asp.net/ajax/downloads/</a>
  </li>
<li>The host server must have at least .net 2.0.
  </li>
<li>ASP.net AJAX Control Toolkit -&nbsp;<a<br />
 href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit"<br />
 style="color: rgb(85, 26, 139); text-decoration: none;">http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit</a></li>
<li>AJAX Validation Guidance Bundle -&nbsp;<a<br />
 href="http://websf.codeplex.com/Wiki/View.aspx?title=Validation_landing_page">http://websf.codeplex.com/Wiki/View.aspx?title=Validation_landing_page</a></li>
</ul>
<h2>STEP 1 &#8211; ASP.net AJAX Extensions</h2>
<div>Before you can add the AJAX Control Toolkit to your site, you need to set it up to work with ASP.net AJAX.</div>
<div>A guide to do this in .net 2.0 can be seen in the previous tutorial.&nbsp;</div>
<div><a<br />
 href="http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/">http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/</a></div>
<h2>STEP 2 &#8211; ASP.net AJAX Control Toolkit</h2>
<div>Before you can add the AJAX ServerSideValidationExtender to your site, you need to set it up to work with AJAX Control Toolkit.</div>
<div>A guide to do this in .net 2.0 can be seen in the previous tutorial.&nbsp;</div>
<div><a<br />
 href="http://www.aaronblake.co.uk/blog/2009/06/04/ajax-control-toolkit-in-aspnet-20/">http://www.aaronblake.co.uk/blog/2009/06/04/ajax-control-toolkit-in-aspnet-20/</a></div>
<h2>STEP 3 &#8211; Add the dll&#8217;s</h2>
<div>
<div>In your web-site&#8217;s bin folder, add the following files from the Validation Guidance Bundle download:</div>
<div>
<ul>
<li>AjaxControlToolkit.WCSFExtensions.dll</li>
<li>Microsoft.Practices.EnterpriseLibrary.Common.dll</li>
<li>Microsoft.Practices.EnterpriseLibrary.Validation.dll</li>
<li>Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.dll</li>
<li>Microsoft.Practices.ObjectBuilder.dll</li>
</ul>
<div>
<h2>STEP 4 &#8211; Add Controls to the Visual Studio Toolbox.</h2>
<div>Add the controls to the Visual Studio Toolbox by doing the following:</div>
<div>
<ul>
<li>Right click on the toolbox and select &#8220;Add Tab&#8221;</li>
<li>Rename the new tab whatever you want, something like AJAX Validation Controls.</li>
<li>Now right click within that tab and select &#8220;Choose items..&#8221;</li>
<li>This will bring up a window, click on the browse button in the .net Framework Components tab and select the AjaxControlToolkit.WCSFExtensions.dll.</li>
<li>This will add the controls to the toolbox, enabling you to drag and drop them into web pages.</li>
</ul>
<div>
<h2>STEP 5 &#8211; Register dll in page to be used</h2>
<div>If you drag the ServerSideValidationExtender from the toolbox, this step should happen automatically, however if it doesn&#8217;t then make sure you do the following.</div>
<div>At the top of the page you wish to use the controls, add the register prefix:</div>
<pre class="brush:xml">

<%@
Register
Assembly=”AjaxControlToolkit.WCSFExtensions”
Namespace=”AjaxControlToolkit.WCSFExtensions”
TagPrefix=”ajaxtoolkitwcsfextensions”
%>
</pre>
<h2>STEP 6 &#8211; Add control to page</h2>
<div>You will now be able to use the ServerSideValidationExtender that page within your site.</div>
<div>Just add one, for example:</div>
<pre class="brush:xhtml">
<h1>AJAX Server Side Validation</h1>

This is an example of using server side validation,
client side by using ASP.net AJAX and the validation extension
controls.

<asp:ScriptManager ID=”ScriptManager1″ runat=”server”></asp:ScriptManager>

<asp:Label ID=”Label1″ runat=”server” Text=”Enter a number” AssociatedControlID=”TextBox1″></asp:Label>

<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>

<asp:CustomValidator ID=”CustomValidator1″ runat=”server”
ErrorMessage=”That is not a number” ControlToValidate=”TextBox1″ />

<ajaxtoolkitwcsfextensions:ServerSideValidationExtender
ID=”ServerSideValidationExtender1″ runat=”server” TargetControlID=”CustomValidator1″ />
</pre>
<div>Code Behind:</div>
<pre class="brush:vbnet">

Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
	Handles CustomValidator1.ServerValidate
	args.IsValid = validateNumber()
End Sub

Function validateNumber() As Boolean
	If IsNumeric(TextBox1.Text) Then
		Return True
	Else
		Return False
	End If
End Function
</pre>
<h2>Further Info</h2>
<div>For more information, please<br />
visit:&nbsp;<a<br />
 href="http://websf.codeplex.com/Wiki/View.aspx?title=Validation_landing_page"<br />
 style="color: rgb(85, 26, 139);">http://websf.codeplex.com/Wiki/View.aspx?title=Validation_landing_page</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-server-side-custom-validation-aspnet-20/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AJAX Control Toolkit in ASP.net 2.0</title>
		<link>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-control-toolkit-in-aspnet-20/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-control-toolkit-in-aspnet-20/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 15:52:17 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=110</guid>
		<description><![CDATA[Introduction This tutorial will cover how to use the new controls in the ASP.net AJAX Control Toolkit with your old ASP.net 2.0 websites. This means you can use a whole host of new useful pre-built code, to quickly take advantage of the power of AJAX. For a demo of the controls go here:&#160;http://www.asp.net/ajax/ajaxcontroltoolkit/samples/ Requirements Visual [...]]]></description>
			<content:encoded><![CDATA[<h2><font size="4">Introduction<br />
</font></h2>
<div>
</div>
<div>This tutorial will cover how to use the new controls in the ASP.net AJAX Control Toolkit with your old ASP.net 2.0 websites.</div>
<div>
</div>
<div>This means you can use a whole host of new useful pre-built code, to quickly take advantage of the power of AJAX. For a demo of the controls go here:&nbsp;<a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/">http://www.asp.net/ajax/ajaxcontroltoolkit/samples/</a></div>
<div>
</div>
<h2><font size="4">Requirements<br />
</font></h2>
<div>
</div>
<div>
<ul>
<li>Visual Studio 2005 or higher.
</li>
<li>ASP.net AJAX Extensions installed on the development machine.&nbsp;<a href="http://www.asp.net/ajax/downloads/" style="color: rgb(85, 26, 139)">http://www.asp.net/ajax/downloads/</a>
</li>
<li>The host server must have at least .net 2.0.
</li>
<li>ASP.net AJAX Control Toolkit -&nbsp;<a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit" style="text-decoration: none;">http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit</a></li>
</ul>
</div>
<div>
</div>
<div>
</div>
<h2><font size="4">STEP 1 &#8211; ASP.net AJAX Extensions</font></h2>
<div>Before you can add the AJAX Control Toolkit to your site, you need to set it up to work with ASP.net AJAX.</div>
<div>A guide to do this in .net 2.0 can be seen in the previous tutorial.&nbsp;</div>
<div><a href="http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/">http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/</a></div>
<div>
</div>
<div>
<h2><font size="4">STEP 2 &#8211; Add the dll&#8217;s</font></h2>
<div>In your web-site&#8217;s bin folder, add the following file from the control kit download:</div>
<div>
<ul>
<li>AjaxControlToolkit.dll</li>
</ul>
<div>
<h2><font size="4">STEP 3 &#8211; Add Controls to the Visual Studio Toolbox.</font></h2>
<div>Add the controls to the Visual Studio Toolbox by doing the following:</div>
<div>
<ul>
<li>Right click on the toolbox and select &#8220;Add Tab&#8221;</li>
<li>Rename the new tab whatever you want, something like AJAX Controls.</li>
<li>Now right click within that tab and select &#8220;Choose items..&#8221;</li>
<li>This will bring up a window, click on the browse button in the .net Framework Components tab and select the AjaxControlToolkit.dll.</li>
<li>This will add the controls to the toolbox, enabling you to drag and drop them into web pages.</li>
</ul>
</div>
<div>
</div>
</div>
<div>
<h2><font size="4">STEP 4 &#8211; Register dll in page to be used</font></h2>
<div>If you drag a control from the toolbox, this step should happen automatically, however if it doesn&#8217;t then make sure you do the following.</div>
<div>
</div>
<div>At the top of the page you wish to use the controls, add the register prefix:</div>
<div>
<p class="MsoNormal"><span style="<br />
background:yellow"><font size="2">&lt;%</font></span><span style="color:blue"><font size="2">@</font></span> <span style="color:#A31515">Register</span> <span style="color:red">Assembly</span><span style="color:blue">=&#8221;AjaxControlToolkit&#8221;</span><br />
<span style="color:red">Namespace</span><span style="color:blue">=&#8221;AjaxControlToolkit&#8221;</span><br />
<span style="color:red">TagPrefix</span><span style="color:blue">=&#8221;ajaxToolkit&#8221;</span><br />
<span style="background:yellow">%&gt;</span></p>
<p class="MsoNormal">
</p>
<p class="MsoNormal">
<h2><font size="4">STEP 5 &#8211; Add control to page</font></h2>
<div>You will now be able to use a a conrtol from the toolkit on that page within your site.</div>
<div>Just add one, for example:</div>
<div>
<p class="MsoNormal"><span style="<br />
color:blue"><font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">ajaxToolkit</font></span><span style="<br />
color:blue"><font size="2">:</font></span><span style="color:#A31515"><font size="2">CollapsiblePanelExtender</font></span> <span style="color:red">ID</span><span style="color:blue">=&#8221;cpe1&#8243;</span><br />
<span style="color:red">runat</span><span style="color:blue">=&#8221;Server&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">TargetControlID</span><span style="color:blue">=&#8221;Panel2&#8243;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">Collapsed</span><span style="color:blue">=&#8221;true&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">CollapsedText</span><span style="color:blue">=&#8221;Show<br />
Details&#8230;&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">ExpandedText</span><span style="color:blue">=&#8221;Hide<br />
Details&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">TextLabelID</span><span style="color:blue">=&#8221;Label1&#8243;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">ExpandControlID</span><span style="color:blue">=&#8221;CollapseHeader&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">CollapseControlID</span><span style="color:blue">=&#8221;CollapseHeader&#8221;</span></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red">SuppressPostBack</span><span style="color:blue">=&#8221;true&#8221;</span><br />
<span style="color:blue">/&gt;</span></p>
</div>
</div>
<div>
</div>
<div>For further information, please visit:</div>
<div><a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit">http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit</a></div>
</div>
</div>
<div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/06/04/ajax-control-toolkit-in-aspnet-20/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.net AJAX in .net 2.0</title>
		<link>http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/</link>
		<comments>http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/#comments</comments>
		<pubDate>Thu, 14 May 2009 10:16:31 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.aaronblake.co.uk/blog/?p=107</guid>
		<description><![CDATA[ASP.net AJAX in .net 2.0 Introduction This tutorial is a quick guide to get any ASP.net 2.0 sites running ASP.net AJAX extensions and controls, even if it hasn&#8217;t been installed on the host server. I won&#8217;t cover how to use the AJAX controls, because there is plenty of documentation out there on this already. Requirements [...]]]></description>
			<content:encoded><![CDATA[<h1>ASP.net AJAX in .net 2.0<br />
</h1>
<div>
</div>
<h2>Introduction<br />
</h2>
<div>
</div>
<div>This tutorial is a quick guide to get any ASP.net 2.0 sites running ASP.net AJAX extensions and controls, even if it hasn&#8217;t been installed on the host server. I won&#8217;t cover how to use the AJAX controls, because there is plenty of documentation out there on this already.</div>
<div>
</div>
<h2>Requirements<br />
</h2>
<div>
</div>
<div>
<ul>
<li>Visual Studio 2005 or higher.
</li>
<li>ASP.net AJAX Extensions installed on the development machine. <a href="http://www.asp.net/ajax/downloads/">http://www.asp.net/ajax/downloads/</a>
</li>
<li>The host server must have at least .net 2.0.
</li>
</ul>
</div>
<div>
</div>
<div>
</div>
<h2>STEP 1 &#8211; Add AJAX Extensions to project<br />
</h2>
<div>
<ul>
<li>Create a new or open an existing website in Visual Studio.
</li>
<li>Create a bin folder in the root of the project.
</li>
<li>Copy the following files from C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025 , into the bin folder of your website:
</li>
<ul>
<li>System.Web.Extensions.dll
</li>
<li><span class="misspell" suggestions="">AJAXExtensionsToolbox</span>.<span class="misspell" suggestions="Dall,Dell,Dill,Doll,dell">dll</span>
</li>
<li>System.Web.Extensions.Design.dll
</li>
</ul>
</ul>
</div>
<div></div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none"><p>(note &#8211; The location of the AJAX <span class="misspell" suggestions="dells,dills,dolls,dulls,ells">dlls</span> may be in a different folder depending on your system setup. If you cant find them, then reinstall the extensions on to your machine.)
</p></blockquote>
<div>
</div>
<h2>STEP 2 &#8211; Configure web.<span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span><br />
</h2>
<div>You need to make sure you add the following sections to your web <span class="misspell" suggestions="con fig,con-fig,Cong,confide,confine">config</span> to get the extensions to work:</div>
<h3>Assemblies Section <br />
</h3>
<div>
<pre id="pre0" style=" background-color: rgb(251, 237, 187)"><span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">compilation</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">assemblies</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
    <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">add</span> <span class="code-attribute" style=" border-color: initial; color: red">assembly</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.Extensions, Version=1.0.61025.0,
                   Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">assemblies</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">compilation</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
<span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span></pre>
</div>
<div>
</div>
<h3>Pages Section <br />
</h3>
<div>
<pre id="pre1" style=" background-color: rgb(251, 237, 187)"><span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">Pages</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
  <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">Control</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">add</span> <span class="code-attribute" style=" border-color: initial; color: red"><span class="misspell" suggestions="tag Prefix,tag-Prefix,coprophagous">tagPrefix</span></span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">asp"</span> <span class="code-attribute" style=" border-color: initial; color: red"><span class="misspell" suggestions="name space,name-space,names pace,names-pace,namesakes">namespace</span></span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.UI"</span>
      <span class="code-attribute" style=" border-color: initial; color: red">assembly</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.Extensions, Version=1.0.61025.0,
                Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
  <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">Control</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">Pages</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
<span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span></pre>
</div>
<div>
</div>
<h3><span class="misspell" suggestions="Http Handlers,Http-Handlers">HttpHandlers</span> <br />
</h3>
<div>
<pre id="pre2" style=" background-color: rgb(251, 237, 187)"><span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)"><span class="misspell" suggestions="http Handlers,http-Handlers">httpHandlers</span></span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
  <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">remove</span> <span class="code-attribute" style=" border-color: initial; color: red">verb</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*"</span> <span class="code-attribute" style=" border-color: initial; color: red">path</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*.<span class="misspell" suggestions="USMC,Asama,ask,ism,Esma">asmx</span>"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">add</span> <span class="code-attribute" style=" border-color: initial; color: red">verb</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*"</span> <span class="code-attribute" style=" border-color: initial; color: red">path</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*.<span class="misspell" suggestions="USMC,Asama,ask,ism,Esma">asmx</span>"</span> <span class="code-attribute" style=" border-color: initial; color: red">validate</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">false"</span>
      <span class="code-attribute" style=" border-color: initial; color: red">type</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
            Version=1.0.61025.0, Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">add</span> <span class="code-attribute" style=" border-color: initial; color: red">verb</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*"</span> <span class="code-attribute" style=" border-color: initial; color: red">path</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">*_<span class="misspell" suggestions="App Service,App-Service,Approves,Appositives,Passivise">AppService</span>.<span class="misspell" suggestions="axed,Ax,ax,Axe,axe">axd</span>"</span> <span class="code-attribute" style=" border-color: initial; color: red">validate</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">false"</span>
      <span class="code-attribute" style=" border-color: initial; color: red">type</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
            Version=1.0.61025.0, Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-attribute" style=" border-color: initial; color: red">s</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
   <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">add</span> <span class="code-attribute" style=" border-color: initial; color: red">verb</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">GET,HEAD"</span> <span class="code-attribute" style=" border-color: initial; color: red">path</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue"><span class="misspell" suggestions="Script Resource,Script-Resource,Scriptures,Scripture's,Scriptorium's">ScriptResource</span>.<span class="misspell" suggestions="axed,Ax,ax,Axe,axe">axd</span>"</span>
      <span class="code-attribute" style=" border-color: initial; color: red">type</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
            Version=1.0.61025.0, Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35"</span>
      <span class="code-attribute" style=" border-color: initial; color: red">validate</span><span class="code-keyword" style=" border-color: initial; color: blue">="</span><span class="code-keyword" style=" border-color: initial; color: blue">false"</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
 <span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)"><span class="misspell" suggestions="http Handlers,http-Handlers">httpHandlers</span></span><span class="code-keyword" style=" border-color: initial; color: blue">></span>
<span class="code-keyword" style=" border-color: initial; color: blue">&lt;</span><span class="code-keyword" style=" border-color: initial; color: blue">/</span><span class="code-leadattribute" style=" border-color: initial; color: rgb(128, 0, 0)">system.web</span><span class="code-keyword" style=" border-color: initial; color: blue">></span></pre>
</div>
<div>
</div>
<h3>System.<span class="misspell" suggestions="Web Server,Web-Server,Observer,Webster,Observe">WebServer</span><br />
</h3>
<div>After the system.web element, add the following:</div>
<div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:blue">  <font size="2">&lt;</font></span><span style="color:#A31515"><font size="2">system.<span class="misspell" suggestions="web Server,web-Server,observer,Webster,observe">webServer</span></font></span><span style="color:blue"><font size="2">></font></span></p>
<p class="MsoNormal"><span style="color:blue">    <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">modules</font></span><span style="<br />
color:blue"><font size="2">></font></span>
</p>
<p class="MsoNormal"><span style="color:blue">      <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">add</font></span> <span style="color:red"><font size="2">name</font></span><span style="color:blue"><font size="2">=</font></span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="Script Module,Script-Module">ScriptModule</span></span><font size="2">&#8221; </font><span style="color:red"><span class="misspell" suggestions="precondition,preconditions,recondition,precondition's,preconditioned">preCondition</span></span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="integrated Mode,integrated-Mode">integratedMode</span></span><font size="2">&#8221; </font><span style="color:red">type</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">System.Web.Handlers.ScriptModule,<br />
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, <span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35</span><font size="2">&#8220;</font><span style="color:blue">/></span></p>
<p class="MsoNormal"><span style="color:blue">    <font size="2">&lt;/</font></span><span style="<br />
color:#A31515"><font size="2">modules</font></span><span style="<br />
color:blue"><font size="2">></font></span></p>
<p class="MsoNormal"><span style="color:blue">    <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">handlers</font></span><span style="<br />
color:blue"><font size="2">></font></span></p>
<p class="MsoNormal"><span style="color:blue">      <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">remove</font></span> <span style="color:red"><font size="2">name</font></span><span style="color:blue"><font size="2">=</font></span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="">WebServiceHandlerFactory</span>-Integrated</span><font size="2">&#8220;</font><span style="color:blue">/></span></p>
<p class="MsoNormal"><span style="color:blue">      <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">add</font></span> <span style="color:red"><font size="2">name</font></span><span style="color:blue"><font size="2">=</font></span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="">ScriptHandlerFactory</span></span><font size="2">&#8221; </font><span style="color:red">verb</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">*</span><font size="2">&#8221; </font><span style="color:red">path</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">*.<span class="misspell" suggestions="USMC,Asama,ask,ism,Esma">asmx</span></span><font size="2">&#8221; </font><span style="color:red"><span class="misspell" suggestions="precondition,preconditions,recondition,precondition's,preconditioned">preCondition</span></span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="integrated Mode,integrated-Mode">integratedMode</span></span><font size="2">&#8221; </font><span style="color:red">type</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">System.Web.Script.Services.ScriptHandlerFactory,<br />
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,<br />
<span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35</span><font size="2">&#8220;</font><span style="color:blue">/></span></p>
<p class="MsoNormal"><span style="color:blue">      <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">add</font></span> <span style="color:red"><font size="2">name</font></span><span style="color:blue"><font size="2">=</font></span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="">ScriptHandlerFactoryAppServices</span></span><font size="2">&#8221; </font><span style="color:red">verb</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">*</span><font size="2">&#8221; </font><span style="color:red">path</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">*_<span class="misspell" suggestions="App Service,App-Service,Approves,Appositives,Passivise">AppService</span>.<span class="misspell" suggestions="axed,Ax,ax,Axe,axe">axd</span></span><font size="2">&#8221; </font><span style="color:red"><span class="misspell" suggestions="precondition,preconditions,recondition,precondition's,preconditioned">preCondition</span></span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="integrated Mode,integrated-Mode">integratedMode</span></span><font size="2">&#8221; </font><span style="color:red">type</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">System.Web.Script.Services.ScriptHandlerFactory,<br />
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,<br />
<span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35</span><font size="2">&#8220;</font><span style="color:blue">/></span></p>
<p class="MsoNormal"><span style="color:blue">      <font size="2">&lt;</font></span><span style="<br />
color:#A31515"><font size="2">add</font></span> <span style="color:red"><font size="2">name</font></span><span style="color:blue"><font size="2">=</font></span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="Script Resource,Script-Resource,Scriptures,Scripture's,Scriptorium's">ScriptResource</span></span><font size="2">&#8221; </font><span style="color:red"><span class="misspell" suggestions="precondition,preconditions,recondition,precondition's,preconditioned">preCondition</span></span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="integrated Mode,integrated-Mode">integratedMode</span></span><font size="2">&#8221; </font><span style="color:red">verb</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">GET,HEAD</span><font size="2">&#8221; </font><span style="color:red">path</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue"><span class="misspell" suggestions="Script Resource,Script-Resource,Scriptures,Scripture's,Scriptorium's">ScriptResource</span>.<span class="misspell" suggestions="axed,Ax,ax,Axe,axe">axd</span></span><font size="2">&#8221; </font><span style="color:red">type</span><span style="color:blue">=</span><font size="2">&#8220;</font><span style="color:blue">System.Web.Handlers.ScriptResourceHandler,<br />
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,<br />
<span class="misspell" suggestions="">PublicKeyToken</span>=31bf3856ad364e35</span><font size="2">&#8220;</font><span style="color:blue">/></span></p>
<p class="MsoNormal"><span style="color:blue">    <font size="2">&lt;/</font></span><span style="<br />
color:#A31515"><font size="2">handlers</font></span><span style="<br />
color:blue"><font size="2">></font></span></p>
<p class="MsoNormal"><span style="color:blue">  <font size="2">&lt;/</font></span><span style="<br />
color:#A31515"><font size="2">system.<span class="misspell" suggestions="web Server,web-Server,observer,Webster,observe">webServer</span></font></span><span style="<br />
color:blue"><font size="2">></font></span></p>
<p class="MsoNormal">
</p>
<h2>Conclusion<br />
</h2>
<p class="MsoNormal">
</p>
</div>
</div>
</div>
<p>Your website should be now ASP.net AJAX ready.</p>
<div>For more information you can check out this good article here:</div>
<div><a href="http://www.codeproject.com/KB/ajax/EnableAjax.aspx">http://www.codeproject.com/KB/ajax/EnableAjax.aspx</a>
</div>
<div>
</div>
<div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronblake.co.uk/blog/2009/05/14/aspnet-ajax-in-net-20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.386 seconds -->

