<?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>moopoo.net &#187; SharePoint</title>
	<atom:link href="http://moopoo.net/tag/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://moopoo.net</link>
	<description>Fishing, technology and anything else</description>
	<lastBuildDate>Wed, 09 Jun 2010 11:34:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validation Group with SharePoint DateTimeControl</title>
		<link>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/</link>
		<comments>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:57:30 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=109</guid>
		<description><![CDATA[The SharePoint DateTimeControl has a property called IsRequiredField, which will act like a RequiredFieldValidator for the control. The problem is when working with web parts in SharePoint calling Page.Validate in your web part can have unexpected results. It often ends up firing validators elsewhere on the page, particularly if the web part is used on [...]]]></description>
			<content:encoded><![CDATA[<p>The SharePoint DateTimeControl has a property called IsRequiredField, which will act like a RequiredFieldValidator for the control. The problem is when working with web parts in SharePoint calling Page.Validate in your web part can have unexpected results. It often ends up firing validators elsewhere on the page, particularly if the web part is used on a list form for example.<br />
One answer of course is to use a validation group in your web part, this is where the DateTimeControl falls down as it doesn&#8217;t have this property.</p>
<p>The answer to this to create a validator in your webpart and hook it into the TextBox element of the DateTimeControl, which will then allow you to set the validation group on it.</p>
<p>To do this use the following code when you create your validator.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">valReviewDate.<span style="color: #0000FF;">ControlToValidate</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;{0}${0}Date&quot;</span>, dteReview.<span style="color: #0000FF;">ID</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p><a href="http://sharepointdata.blogspot.com/2009/06/sharepoint-datetime-control-validation.html">This post</a>, describes how to do it from code in front.</p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Web Part button after clicking</title>
		<link>http://moopoo.net/sharepoint/disable-web-part-button/</link>
		<comments>http://moopoo.net/sharepoint/disable-web-part-button/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:24:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=104</guid>
		<description><![CDATA[Not sure how, I got to the end point of this so there may be other ways of doing it.
Basically I had a web part the when the button was clicked I needed to disable it.
Adding .Attributes["onclick"] didn&#8217;t seem to work, and after trying a few things I managed to get it working this way.
Add [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure how, I got to the end point of this so there may be other ways of doing it.<br />
Basically I had a web part the when the button was clicked I needed to disable it.<br />
Adding .Attributes["onclick"] didn&#8217;t seem to work, and after trying a few things I managed to get it working this way.<br />
Add the following code into OnPreRender of the web part, assuming cmdGenerate is the name of your button.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">cmdGenerate.<span style="color: #0000FF;">Attributes</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;onclick&quot;</span>, Page.<span style="color: #0000FF;">ClientScript</span>.<span style="color: #0000FF;">GetPostBackEventReference</span><span style="color: #000000;">&#40;</span>cmdGenerate, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;;this.value='Please wait...';this.disabled = true;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/disable-web-part-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Custom Masterpage in _layouts directory</title>
		<link>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/</link>
		<comments>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 10:19:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[masterpage]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=97</guid>
		<description><![CDATA[To use a custom or the default masterpage in custom aspx pages located in your _layouts directory use the following code in the code behind for the page.
N.B I didn&#8217;t declare any masterpage useage in the actual aspx file.

protected override void OnPreInit&#40;EventArgs e&#41;
&#123;
    base.OnPreInit&#40;e&#41;;
    // Set the masterpage to [...]]]></description>
			<content:encoded><![CDATA[<p>To use a custom or the default masterpage in custom aspx pages located in your _layouts directory use the following code in the code behind for the page.<br />
N.B I didn&#8217;t declare any masterpage useage in the actual aspx file.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnPreInit<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnPreInit</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080; font-style: italic;">// Set the masterpage to the default.master.</span>
    <span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>SPWeb webCurrent <span style="color: #008000;">=</span> SPControl.<span style="color: #0000FF;">GetContextSite</span><span style="color: #000000;">&#40;</span>Context<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">OpenWeb</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> strUrl <span style="color: #008000;">=</span> webCurrent.<span style="color: #0000FF;">ServerRelativeUrl</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;/_catalogs/masterpage/default.master&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #008080; font-style: italic;">// custom.master is your same default or main master page </span>
        <span style="color: #008080; font-style: italic;">// being used for main portal pages. Change that path according to your need</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">MasterPageFile</span> <span style="color: #008000;">=</span> strUrl<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span> 
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint Web Part Properties</title>
		<link>http://moopoo.net/sharepoint/sharepoint-web-part-properties/</link>
		<comments>http://moopoo.net/sharepoint/sharepoint-web-part-properties/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 15:08:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=62</guid>
		<description><![CDATA[When creating a WebPart inheriting from System.Web.UI.WebControls.WebParts.WebPart, use the following code to add a custom Integer property that will sit in it&#8217;s own Category when you modify the properties of the web part.

private const int _intMaxShiftsPerDay = 0;
private int IntMaxShiftsPerDay = _intMaxShiftsPerDay;
&#91;Category&#40;&#34;Custom Properties&#34;&#41;&#93;
&#91;DefaultValue&#40;_intMaxShiftsPerDay&#41;&#93;
&#91;Personalizable&#40;PersonalizationScope.Shared&#41;&#93;
&#91;WebDisplayName&#40;&#34;Maximum Shifts Allowed Per Day&#34;&#41;&#93;
&#91;WebDescription&#40;&#34;Type in the maximum allowed shifts per day for [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a WebPart inheriting from System.Web.UI.WebControls.WebParts.WebPart, use the following code to add a custom Integer property that will sit in it&#8217;s own Category when you modify the properties of the web part.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">int</span> _intMaxShiftsPerDay <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">private</span> <span style="color: #FF0000;">int</span> IntMaxShiftsPerDay <span style="color: #008000;">=</span> _intMaxShiftsPerDay<span style="color: #008000;">;</span>
<span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Custom Properties&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span>_intMaxShiftsPerDay<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>Personalizable<span style="color: #000000;">&#40;</span>PersonalizationScope.<span style="color: #0000FF;">Shared</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebDisplayName<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Maximum Shifts Allowed Per Day&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebDescription<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Type in the maximum allowed shifts per day for each person&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebBrowsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>XmlElement<span style="color: #000000;">&#40;</span>ElementName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;intMaxShiftsPerDay&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> intMaxShiftsPerDay
<span style="color: #000000;">&#123;</span>
    get
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">return</span> IntMaxShiftsPerDay<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    set
   <span style="color: #000000;">&#123;</span>
        IntMaxShiftsPerDay <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/sharepoint-web-part-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy a sharepoint solution with stsadm</title>
		<link>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/</link>
		<comments>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 11:02:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=59</guid>
		<description><![CDATA[First off we need to add the solution to SharePoint    
 stsadm -o addsolution -filename c:\path-to\filename.wsp
Next, we deploy the solution to the site
stsadm -o deploysolution -name filename.wsp -url http://myurl -immediate Optionally if you use Code Access Security add the following to the above     
-allowcaspoliciesand if you have assemblies [...]]]></description>
			<content:encoded><![CDATA[<p>First off we need to add the solution to SharePoint    </p>
<p> <code>stsadm -o addsolution -filename c:\path-to\filename.wsp</code>
<p>Next, we deploy the solution to the site</p>
<p><code>stsadm -o deploysolution -name filename.wsp -url http://myurl -immediate </code>Optionally if you use Code Access Security add the following to the above     </p>
<p><code>-allowcaspolicies</code>and if you have assemblies that deploy to the GAC, add this line to the deploysolution statement above     </p>
<p><code>-allowgacdeployment</code>This will create a timer job, we then simply need to execute this job     </p>
<p><code>stsadm -o execadmsvcjobs</code></p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
