<?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>Chris: Geek Guy &#187; ASP.NET</title>
	<atom:link href="http://chris.gg/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://chris.gg</link>
	<description>Tech news and other stuff from a UK-based web developer and all-round geek</description>
	<lastBuildDate>Sat, 31 Jul 2010 17:13:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IIS 5.1 (Windows XP) OK button greyed out when adding application mappings</title>
		<link>http://chris.gg/2010/03/iis-5-1-windows-xp-ok-button-greyed-out-when-adding-application-mappings/</link>
		<comments>http://chris.gg/2010/03/iis-5-1-windows-xp-ok-button-greyed-out-when-adding-application-mappings/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:51:49 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[windows xp]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=631</guid>
		<description><![CDATA[This one had me flummoxed until I found the solution on the Microsoft help and support site. Basically you need to click the &#8220;Executable&#8221; text box to initialise the path after you&#8217;ve browsed to the file. It&#8217;s not obvious, but easy to remember once you know the workaround!]]></description>
			<content:encoded><![CDATA[<p>This one had me flummoxed until I found the <a href="http://support.microsoft.com/kb/317948">solution</a> on the Microsoft help and support site.</p>
<p>Basically you need to click the &#8220;Executable&#8221; text box to initialise the path after you&#8217;ve browsed to the file.</p>
<p>It&#8217;s not obvious, but easy to remember once you know the workaround!</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/03/iis-5-1-windows-xp-ok-button-greyed-out-when-adding-application-mappings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint and getElementById()</title>
		<link>http://chris.gg/2010/02/sharepoint-and-getelementbyid/</link>
		<comments>http://chris.gg/2010/02/sharepoint-and-getelementbyid/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:18:17 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[getelementbyid]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sharepoint]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=624</guid>
		<description><![CDATA[I&#8217;ve just found out that using JavaScript&#8217;s getElementById() function doesn&#8217;t quite work as expected when dealing with controls on SharePoint pages. This is because SharePoint uses its own identifiers, so TextBox1 becomes something like ctl00$ctl00$g_3f6d90e4_335b_467c_a53f_6ae00bca6b63$ctl00$TextBox1. Fortunately there&#8217;s a simple solution &#8211; instead of the following (which will cause an &#8220;Object required&#8221; JavaScript error): document.getElementById("TextBox1"); you need [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just found out that using JavaScript&#8217;s <strong>getElementById()</strong> function doesn&#8217;t quite work as expected when dealing with controls on SharePoint pages. This is because SharePoint uses its own identifiers, so <strong>TextBox1 </strong> becomes something like <strong>ctl00$ctl00$g_3f6d90e4_335b_467c_a53f_6ae00bca6b63$ctl00$TextBox1</strong>.</p>
<p>Fortunately there&#8217;s a simple solution &#8211; instead of the following (which will cause an &#8220;Object required&#8221; JavaScript error):</p>
<pre lang="csharp">document.getElementById("TextBox1");</pre>
<p>you need to use this, which will insert the correct full ID for the element and thus work correctly:</p>
<pre lang="csharp">document.getElementById("< %=TextBox1.ClientID%>");</pre>
<p>It gets a bit more complicated when using nested controls, which is explained in <a href="http://www.binarywave.com/blogs/eshupps/Lists/Posts/Post.aspx?List=9c93c708-e5ce-4714-bdea-499330361130&amp;ID=23">this post by Eric Shupps</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/02/sharepoint-and-getelementbyid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeTextBox: How to fix &#8220;The type or namespace name &#8216;Toolbar&#8217; could not be found&#8221;</title>
		<link>http://chris.gg/2010/02/freetextbox-how-to-fix-the-type-or-namespace-name-toolbar-could-not-be-found/</link>
		<comments>http://chris.gg/2010/02/freetextbox-how-to-fix-the-type-or-namespace-name-toolbar-could-not-be-found/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 11:57:38 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[freetextbox]]></category>
		<category><![CDATA[freetextboxcontrols]]></category>
		<category><![CDATA[ftb]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[paragraph]]></category>
		<category><![CDATA[toolbar]]></category>
		<category><![CDATA[using]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=614</guid>
		<description><![CDATA[I&#8217;m working on a Visual Studio 2005 ASP.NET project which makes use of FreeTextBox to provide rich text editing capability. My code sets up the toolbar programmatically but, despite following the installation instructions to the letter (including setting up the FTB TagPrefix), my code was failing to compile with The type or namespace name &#8216;Toolbar&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a Visual Studio 2005 ASP.NET project which makes use of <a href="http://freetextbox.com/">FreeTextBox</a> to provide rich text editing capability. My code <a href="http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ToolbarConfiguration">sets up the toolbar programmatically</a> but, despite following the <a href="http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.Installation">installation instructions</a> to the letter (including setting up the FTB TagPrefix), my code was failing to compile with <strong>The type or namespace name &#8216;Toolbar&#8217; could not be found</strong> on the following line of code:</p>
<pre lang="csharp">Toolbar ftbTools = new Toolbar();</pre>
<p>I initially fixed this by adding the FreeTextBoxControls prefix:</p>
<pre lang="csharp">FreeTextBoxControls.Toolbar ftbTools =
                             new FreeTextBoxControls.Toolbar();</pre>
<p>But then my code fell over with a similar error on the very next line:</p>
<pre lang="csharp">ftbTools.Items.Add(new ParagraphMenu());</pre>
<p>Not wanting to have to add the <strong>FreeTextBoxControls</strong> prefix to this and my other 18 <strong>Add</strong> statements, I instead added<strong> </strong>the following <strong>using </strong>statement to my code file:</p>
<pre lang="csharp">using FreeTextBoxControls;</pre>
<p>Job done!</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/02/freetextbox-how-to-fix-the-type-or-namespace-name-toolbar-could-not-be-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check whether a SharePoint user is in a particular group</title>
		<link>http://chris.gg/2010/02/how-to-check-whether-a-sharepoint-user-is-in-a-particular-group/</link>
		<comments>http://chris.gg/2010/02/how-to-check-whether-a-sharepoint-user-is-in-a-particular-group/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:00:51 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[smartpart]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[web part]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=608</guid>
		<description><![CDATA[Here&#8217;s a quick function I wrote to check whether a user is a member of a particular SharePoint group: private bool IsMemberOf(string groupName) { SPUser user = SPContext.Current.Web.CurrentUser; try { if (user.Groups[groupName] != null) return true; else return false; } catch { return false; } } The try-catch is required as &#8211; somewhat counter-intuitively &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick function I wrote to check whether a user is a member of a particular SharePoint group:</p>
<pre lang="csharp">
private bool IsMemberOf(string groupName)
{
    SPUser user = SPContext.Current.Web.CurrentUser;
    try
    {
        if (user.Groups[groupName] != null)
            return true;
        else
            return false;
    }
    catch
    {
        return false;
    }
}
</pre>
<p>The try-catch is required as  &#8211; somewhat counter-intuitively &#8211; SharePoint seems to throw a &#8220;Group not found&#8221; error if the user is not a member of the group.</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/02/how-to-check-whether-a-sharepoint-user-is-in-a-particular-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set SharePoint page title programmatically</title>
		<link>http://chris.gg/2010/02/how-to-set-sharepoint-page-title-programmatically/</link>
		<comments>http://chris.gg/2010/02/how-to-set-sharepoint-page-title-programmatically/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:30:18 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[smartpart]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[web part]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=600</guid>
		<description><![CDATA[I&#8217;ve spent some time today trying to figure out how to set the title of a SharePoint page from my own code. As blogger Michael Becker rightly points out, you can&#8217;t simply set Page.Title. The correct solution, as provided by Michael, is illustrated in this example C# code: // Get a reference to the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent some time today trying to figure out how to set the title of a SharePoint page from my own code. As <a href="http://blogs.pointbridge.com/Blogs/becker_michael/Pages/Post.aspx?_ID=11">blogger Michael Becker rightly points out</a>, you can&#8217;t simply set <strong>Page.Title</strong>.</p>
<p>The correct solution, as provided by Michael, is illustrated in this example C# code:</p>
<pre lang="csharp">// Get a reference to the appropriate Content Placeholder
ContentPlaceHolder contentPlaceHolder = (ContentPlaceHolder)
                       Page.Master.FindControl("PlaceHolderPageTitle");
// Clear out anything that SharePoint might have put in it already
contentPlaceHolder.Controls.Clear();
// Put your content in
LiteralControl literalControl = new LiteralControl();
literalControl.Text = "Your text goes here";
contentPlaceHolder.Controls.Add(literalControl);</pre>
<p>Happily this even works when you &#8220;cheat&#8221; by hosting an ASP.NET user control within a <a href="http://www.codeplex.com/smartpart">SmartPart</a>, as opposed to creating a bona fide Web Part.</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/02/how-to-set-sharepoint-page-title-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy ASP.NET web user controls on SharePoint using SmartPart</title>
		<link>http://chris.gg/2010/02/deploy-asp-net-web-user-controls-on-sharepoint-using-smartpart/</link>
		<comments>http://chris.gg/2010/02/deploy-asp-net-web-user-controls-on-sharepoint-using-smartpart/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 19:04:12 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[smartpart]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=570</guid>
		<description><![CDATA[Today I&#8217;ve been playing with Return of SmartPart 1.3,  a shim which allows you to create SharePoint 2007 web parts using Web User Controls (ASCX files) created by Visual Studio/Visual Web Developer. This is probably the least painful way for C#/VB.NET developers to delve into web part building without having to worry too much about the intricacies [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve been playing with <a href="http://smartpart.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=10697">Return of SmartPart 1.3</a>,  a shim which allows you to create SharePoint 2007 web parts using Web User Controls (ASCX files) created by Visual Studio/Visual Web Developer.</p>
<p>This is probably the least painful way for C#/VB.NET developers to delve into web part building without having to worry too much about the intricacies of the SharePoint platform.</p>
<p>Complete with setup wizard, comprehensive user guide and sample user controls, it&#8217;s a snap to get running, although you will need access to your SharePoint server both to install the SmartPart and any custom user controls. It also optionally supports AJAX controls, after installing Microsoft&#8217;s ASP.NET AJAX extensions.</p>
<p>There&#8217;s no need to use strong naming or even compile your controls &#8211; just drop the .ascx (and .ascx.cs/.vb, if necessary) files into your usercontrols directory and you&#8217;re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/02/deploy-asp-net-web-user-controls-on-sharepoint-using-smartpart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
