<?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>Gabe Hilado&#039;s SharePoint &#38; ASP.NET Blog &#187; Web Parts</title>
	<atom:link href="http://spdeveloper.net/tag/web-parts/feed/" rel="self" type="application/rss+xml" />
	<link>http://spdeveloper.net</link>
	<description>Microsoft, SharePoint, ASP.NET, Software Solutions</description>
	<lastBuildDate>Thu, 29 Sep 2011 15:13:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Metadata Search Web Part is Out!</title>
		<link>http://spdeveloper.net/2011/09/metadata-search-web-part-is-out/</link>
		<comments>http://spdeveloper.net/2011/09/metadata-search-web-part-is-out/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 15:13:35 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=494</guid>
		<description><![CDATA[I am pleased to announce that the Metadata Search Web Part for SharePoint 2010 is now released! The Web Part allows users to do advanced search in SharePoint 2010 with very minimal configuration. The Web Part has the following features: Search SharePoint lists &#8211; perform advanced searches on any SharePoint list or library using metadata Generate [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce that the <a href="http://www.spmetadatasearch.com/">Metadata Search Web Part</a> for SharePoint 2010 is now released! The Web Part allows users to do <strong>advanced search</strong> in SharePoint 2010 with very minimal configuration.</p>
<p style="text-align: center;"><img class="aligncenter" title="Metadata Search Screen" src="http://www.spmetadatasearch.com/Images/search-form-preview.jpg" alt="Metadata Search Screen" /></p>
<p>The Web Part has the following features:</p>
<ul>
<li><a href="http://www.spmetadatasearch.com/sharepoint-list-search/">Search SharePoint lists</a> &#8211; perform advanced searches on any SharePoint list or library using metadata</li>
<li><a href="http://www.spmetadatasearch.com/print-sharepoint-list-report/">Generate reports based on SharePoint list items</a> &#8211; export to print-friendly pages or Word documents</li>
<li><a href="http://www.spmetadatasearch.com/sharepoint-theme-examples/">Adaptive styling</a> &#8211; works with any SharePoint 2010 theme and styling</li>
<li>Open-up SharePoint list items on the search result screen</li>
</ul>
<p>You can <a href="http://www.spmetadatasearch.com/download/">download and try</a> the product today!</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2011/09/metadata-search-web-part-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Part &#8220;Error Creating Control&#8221; in SharePoint Designer</title>
		<link>http://spdeveloper.net/2011/08/web-part-error-creating-control-spd/</link>
		<comments>http://spdeveloper.net/2011/08/web-part-error-creating-control-spd/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 00:34:28 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=478</guid>
		<description><![CDATA[When you are developing custom SharePoint web parts using SharePoint Object Model, it’s not enough that you can properly render contents in “Browse mode”.  Your web part must also take into account when the page it is attached to goes into “Edit mode”. In this blog post, I enumerate the different states the web part [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Error-Creating-Control.png"></a>When you are developing custom SharePoint web parts using SharePoint Object Model, it’s not enough that you can properly render contents in “<strong>Browse mode</strong>”.  Your web part must also take into account when the page it is attached to goes into “<strong>Edit mode</strong>”. In this <a href="http://spdeveloper.net/2009/12/programmatically-check-the-web-part-state/">blog post</a>, I enumerate the different states the web part can be in in any given time. Sometimes, you would want to limit the functionality of the web part when it is not in “Browse mode”. And this is why you <a href="http://spdeveloper.net/2009/12/programmatically-check-the-web-part-state/">check what state</a> the part is in before rendering contents for it.</p>
<p>You must also take into consideration the following use-cases that your web part will participate in:</p>
<ul>
<li>From the site’s <em>Web Part Gallery</em>, clicking the web part and rendering it in “<strong>Preview mode</strong>”.</li>
<li>When editing the page that has the web part in <strong>SharePoint Designer 2010</strong>, that the web part renders properly as a user-control.</li>
</ul>
<p>I want to focus on properly rendering the Web part in SharePoint Designer because this is a use-case that can be commonly missed. Today, I was testing a web part I am developing for Zenpo Software Innovations when I encountered the following error in SharePoint Designer 2010:</p>
<div class="wp-caption aligncenter" style="width: 661px"><a href="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Error-Creating-Control.png"><img title="SPD-Error-Creating-Control" src="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Error-Creating-Control.png" alt="Error Creating Control in SharePoint Designer" width="651" height="422" /></a><p class="wp-caption-text">“Error Creating Control” – what does that mean?</p></div>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">The web part’s <strong>OnLoad </strong>and <strong>OnInit </strong>event-handlers didn’t check that the page is in “<strong>design mode</strong>”. So, it tried to render its content as if it was in browse-mode.</p>
<p style="text-align: left;">The web part uses custom JavaScript. I have to register the scripts in order for the web part to use them. I implement the <a href="http://msdn.microsoft.com/en-us/library/xxc4wkxx.aspx" target="_blank">script-registration</a> during the OnInit event of the web part like the following:</p>
<pre class="brush: csharp;">
        protected override void OnInit(EventArgs e)
        {
                if (!Page.ClientScript.IsClientScriptIncludeRegistered(&quot;Script1&quot;))
                {
                     scriptRegistered = false;
                     Page.ClientScript.RegisterClientScriptInclude(&quot;Script1&quot;,
                            Page.ClientScript.GetWebResourceUrl(this.GetType(),
                            &quot;Zenposoft.Script1.js&quot;));
                }
        }
</pre>
<p>This script registration code works fine on the web browser. The problem is when this code is invoked during SPD-editing of the web part page, <strong>Page.ClientScript.GetWebResourceUrl</strong> returns empty string (under normal browsing state, it would have returned the URL to the WebResource.axd file). And you cannot pass an empty string URL to the Page.ClientScript.RegisterClientScriptInclude method (it will throw an exception if you pass an empty URL). The web part really had no business trying to register scripts during design-time.</p>
<p>You might say to yourself, “this shouldn’t be an issue since Web part pages are edited through the browser anyway”. Think again! Web designers at your organization will use SharePoint Designer at some point to edit SharePoint pages and if your web part cannot handle “design mode” correctly, the designers will see the ugly “<strong>Error Creating Control</strong>” in SPD. You cannot instill confidence in the use of your web part if it’s throwing exceptions in SharePoint Designer!!!</p>
<p>So, how do we fix this? You can use the one of the following or both:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.isdesigntime.aspx" target="_blank">SPContext.Current.IsDesignTime</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.designmode.aspx" target="_blank">Control.DesignMode</a></li>
</ul>
<p>I found this <a href="http://blogs.msdn.com/b/sharepointdesigner/archive/2008/10/03/best-practice-to-create-designer-friendly-server-controls.aspx" target="_blank">Microsoft SharePoint Designer Team Blog post</a> that has nice explanation on how to create “designer friendly controls”. <strong>SPContext.Current.IsDesignTime</strong> and <strong>Control.DesignMode</strong> are mentioned in that blog post.</p>
<p>First, I modify the OnInit event-handler such that I register scripts only when “not in design mode”:</p>
<pre class="brush: csharp;">
        protected override void OnInit(EventArgs e)
        {
            if (!this.DesignMode &amp;&amp; !SPContext.Current.IsDesignTime)
            {
                if (!Page.ClientScript.IsClientScriptIncludeRegistered(&quot;Script1&quot;))
                {
                    scriptRegistered = false;
                    Page.ClientScript.RegisterClientScriptInclude(&quot;Script1&quot;,
                            Page.ClientScript.GetWebResourceUrl(this.GetType(),
                            &quot;Zenposoft.Script1.js&quot;));
                }
            }
        }
</pre>
<p>After deploying the modified Web part, we check SharePoint Designer and the errors are gone:</p>
<div id="attachment_486" class="wp-caption aligncenter" style="width: 671px"><a href="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Error-Gone.png"><img class="size-full wp-image-486" title="SPD-Error-Gone" src="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Error-Gone.png" alt="SPD-Error-Gone" width="661" height="408" /></a><p class="wp-caption-text">SharePoint Designer Errors - Gone</p></div>
<p>Yes, the errors are gone but we need to display something where the web part(s) are embedded. If the web part in on the page, the designer should render something there; it can’t be just white-space.</p>
<p>In order to render something in “design mode”, we override the <strong>Render</strong> method of the web part:</p>
<pre class="brush: csharp;">
        protected override void Render(HtmlTextWriter writer)
        {
            if (this.DesignMode || SPContext.Current.IsDesignTime)
            {
                writer.Write(&quot;&lt;input type=&quot;button&quot; value=&quot;Web part is in edit mode...&quot; /&gt;&quot;);
            }
            else
            {
                base.Render(writer);
            }
        }
</pre>
<p>If the web part is in “design mode”, we render a simple HTML button. Otherwise, we let the base class (WebPart) handle the rendering. Deploy the updated web part and you should now see the following in SharePoint Designer:</p>
<div id="attachment_487" class="wp-caption aligncenter" style="width: 448px"><a href="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Render-Control.png"><img class="size-full wp-image-487" title="SPD-Render-Control" src="http://spdeveloper.net/wp-content/uploads/2011/08/SPD-Render-Control.png" alt="SPD-Render-Control" width="438" height="261" /></a><p class="wp-caption-text">Render HTML button in Desing Mode</p></div>
<p>To summarize, you will want to render web parts correctly in designers such as SPD 2010.  The likelihood that Web designers will edit SharePoint pages in SPD is high enough that you will want to “design mode” for your web part to run properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2011/08/web-part-error-creating-control-spd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create &#8216;Open Tool Pane&#8217; link in custom .NET Web Parts for SharePoint 2010</title>
		<link>http://spdeveloper.net/2011/07/create-open-tool-pane-link-in-custom-net-web-parts-for-sharepoint-2010/</link>
		<comments>http://spdeveloper.net/2011/07/create-open-tool-pane-link-in-custom-net-web-parts-for-sharepoint-2010/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 18:30:29 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=466</guid>
		<description><![CDATA[Back in SharePoint 2007, it was pretty popular to use the built-in Javascript function MSOTlPn_ShowToolPane2Wrapper to put the Web part page into edit mode and have the Web part properties editable. Typically, you would put something like the following in your Web part class code: protected override void OnPreRender(EventArgs e) { if (this.Page != null) [...]]]></description>
			<content:encoded><![CDATA[<p>Back in SharePoint 2007, it was pretty popular to use the built-in Javascript function <strong>MSOTlPn_ShowToolPane2Wrapper</strong> to put the Web part page into edit mode and have the Web part properties editable. Typically, you would put something like the following in your Web part class code:</p>
<pre class="brush: csharp;">
protected override void OnPreRender(EventArgs e)
{
   if (this.Page != null)
   {
      if (string.IsNullOrEmpty(SelectedListName))
      {
            placeHolderLiteral.Text = &quot;
Web part is not configured. Please &lt;a href=&quot;\&amp;quot;javascript:MSOTlPn_ShowToolPane2Wrapper('Edit',&quot;&gt;edit the Web part&lt;/a&gt; and choose a list or library.

&quot;;
      }
   }
}
</pre>
<p>In the example above, I render a &#8220;please configure the Web part&#8221; message whenever the SelectedListName of the Web part is not set.</p>
<p>I&#8217;m currently developing a Web part for SharePoint 2010 and I wanted to have a &#8220;configure&#8221; link displayed for the Web part whenever Web properties (i.e. list name, view ID etc.) are not set or specified . I embed a code similar to the above snippet where I use <strong>MSOTlPn_ShowToolPane2Wrapper</strong><strong>. </strong>It didn&#8217;t work!</p>
<p>So, thinking like a developer, I observe how the out-of-the-box Web parts render an &#8220;open tool pane&#8221; hyperlink. I add an Image Viewer web part to a web part page and look at the structure of the hyperlink. Here&#8217;s what I saw:<br />
<a href="http://spdeveloper.net/wp-content/uploads/2011/07/ShowToolPane2Wrapper.png"></a></p>
<p><img class="aligncenter size-full wp-image-467" title="ShowToolPane2Wrapper function" src="http://spdeveloper.net/wp-content/uploads/2011/07/ShowToolPane2Wrapper.png" alt="ShowToolPane2Wrapper function" width="745" height="259" /><br />
I replaced my output code in my web part class from <strong>MSOTlPn_ShowToolPane2Wrapper to <strong>ShowToolPane2Wrapper </strong></strong>and it works!<br />
Please note that I encourage that you put &#8216;this&#8217; (object) as the second argument instead of &#8217;129&#8242;, or &#8217;16&#8242; as you see in some blogs out there. The second parameter is supposed to indicate which Web part to edit. Do you really know at run-time that your Web part is &#8217;129&#8242; or &#8217;16&#8242;? You don&#8217;t! So simply use &#8216;this&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2011/07/create-open-tool-pane-link-in-custom-net-web-parts-for-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Visual Web Part Project</title>
		<link>http://spdeveloper.net/2010/06/visual-studio-2010-visual-web-part-project/</link>
		<comments>http://spdeveloper.net/2010/06/visual-studio-2010-visual-web-part-project/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 03:06:19 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Parts]]></category>
		<category><![CDATA[WSP]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=334</guid>
		<description><![CDATA[I am in the process of getting up to speed with the new Visual Studio 2010 IDE and how it can be used to develop custom SharePoint 2010 solutions. It’s so easy to do a “Hello World” Web part project now. These days, my Hello World projects typically involve opening up a database table and [...]]]></description>
			<content:encoded><![CDATA[<p>I am in the process of getting up to speed with the new <strong>Visual Studio 2010</strong> IDE and how it can be used to develop custom SharePoint 2010 solutions.</p>
<p>It’s so easy to do a “Hello World” Web part project now. These days, my Hello World projects typically involve opening up a database table and displaying records in a table. I was able to do this with minimal coding and got it up and running—a full blown Web part—in under 15 minutes!</p>
<p>I created a sample project that opens up the <a href="http://msftdbprodsamples.codeplex.com/" target="_blank">AdventureWorks</a> database and displays employee records in a table:</p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 344px"><a href="http://spdeveloper.net/wp-content/uploads/2010/06/image1.png"><img style="display: block; border: 0px;" title="Sample Visual Web Part Project using Adventure Works Database" src="http://spdeveloper.net/wp-content/uploads/2010/06/image_thumb1.png" border="0" alt="Sample Visual Web Part Project using Adventure Works Database" width="334" height="430" /></a><p class="wp-caption-text">Sample Visual Web Part Project using Adventure Works Database</p></div>
<p style="text-align: left;">The Web-part looks like the following when used inside SharePoint:</p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 733px"><a href="http://spdeveloper.net/wp-content/uploads/2010/06/image2.png"><img style="display: inline; border: 0px;" title="AdventureWorks Employees Web Part" src="http://spdeveloper.net/wp-content/uploads/2010/06/image_thumb2.png" border="0" alt="AdventureWorks Employees Web Part" width="723" height="384" /></a><p class="wp-caption-text">AdventureWorks Employees Web Part So far, I like it!Here are my first impressions:SharePoint project templates come out-of-the-box install of VS 2010. After installing VS 2010, the SharePoint project templates are ready for use. No need to do installations of VS-extensions.SharePoint Project Templates in Visual Studio 2010</p></div>
<p style="text-align: center;"> </p>
<ul>
<li>The <strong>Visual Web Part</strong> project cannot be deployed as a “sandboxed solution”. It has to be deployed as a <strong>farm solution</strong>.</li>
<li><strong>Project-debugging became a lot easier</strong> even with a full-blow farm-deployment. Press F5 in the VS 2010 IDE and Visual Studio will build, package, deploy, and activate your feature, and launch the debug-browser all in one click! When you’re done debugging, terminate Internet Explorer, Visual Studio will deactivate and retract the solution out of SharePoint.</li>
<li>IIS-reset (for the target Web app) even for full-blown deployments when debugging is fast!</li>
<li>Remember in VSeWSS 1.3 where you had to Google first <a href="http://www.google.com/#hl=en&amp;rlz=1W1ADRA_en&amp;q=vsewss+1.3+specify+web+part+group+element.xml&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=vsewss+1.3+specify+web+part+group+element.xml&amp;gs_rfai=&amp;fp=7b315f504f01d538" target="_blank">how to specify the group the Web part appears in</a> because it wasn’t so obvious? Well, it got easier in VS 2010! Now, the E<strong>lements.xml</strong> file has a place-holder for the <strong>Web-part group</strong>. All you have to do, is change it from “<em>Custom</em>” to whatever value you want it to be. It’s so visible now you can’t miss it.</li>
</ul>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 626px"><a href="http://spdeveloper.net/wp-content/uploads/2010/06/image4.png"><img style="display: block; border: 0px;" title="Web-Part Group Place-Holder in Elements.xml File" src="http://spdeveloper.net/wp-content/uploads/2010/06/image_thumb4.png" border="0" alt="Web-Part Group Place-Holder in Elements.xml File" width="616" height="277" /></a><p class="wp-caption-text">Web-Part Group Place-Holder in Elements.xml File</p></div>
<p style="text-align: center;"> </p>
<ul>
<li>You can now <strong>add Web User Controls (ASCX files) into the project!</strong> As a matter of fact, the project template adds one ASCX file for you. This just made Web Part development a HECK of a lot easier! This is HUGE! Back in VS 2008 developing SharePoint 2007 Web parts, there were no designers available. If developers wanted to use ASCX files, they had to create regular ASP.NET Web apps, design the ASCX files there, write the code-behind, compile the project so the code-behind logic gets packaged with the ASCX files, deploy the ASCX files to UserControls folder within the SharePoint virtual Web app folder, deploy and enable Smart Part, add a Smart Part Web part to the SharePoint pages, then finally, hook-up the Smart Part to the ASCX files. Whew!!! Talk about LOTS of steps! In VS 2010, you don’t need Smart Part or that lengthy way to integrate ASCX file in SharePoint anymore. The challenge of “imagining” what your Web part will look like as you write your C# code is no more. The designer is built in to the Visual Web Part project. Leverage your ASP.NET skills to the max.</li>
<li>Despite all the improvements, Web part development veterans should recognize familiar concepts and project files such as Elements.xml, .webpart file, strong-named key file, packages and features. </li>
</ul>
<p>I have many ASP.NET developer friends who didn’t want to get into SharePoint development because:</p>
<ul>
<li>The Web part project wasn’t easy in SharePoint 2007. No designers, hard to design a visual element.</li>
<li>ASP.NET developers got accustomed to easy debugging of their projects by simply pressing F5 key or the play button on the IDE toolbar. In 2007, ASP.NET developers thought deploying the app and then attaching to the w3wp.exe process (multiple manual steps, not one) was too cumbersome.</li>
<li>It took forever to even debug the code because the SharePoint Web app always recycled on deployments.</li>
</ul>
<p>If you are an ASP.NET developer contemplating if you should try SharePoint development, I highly recommend you try it NOW! SharePoint 2010 development feels like traditional ASP.NET development more than ever!</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2010/06/visual-studio-2010-visual-web-part-project/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>SharePoint &#8220;Developers&#8221; and &#8220;Administrators&#8221;</title>
		<link>http://spdeveloper.net/2010/04/sharepoint-developers-and-administrators/</link>
		<comments>http://spdeveloper.net/2010/04/sharepoint-developers-and-administrators/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 02:25:11 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Administrators]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[SharePoint Installation]]></category>
		<category><![CDATA[STSADM]]></category>
		<category><![CDATA[Web Parts]]></category>
		<category><![CDATA[WSP]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=208</guid>
		<description><![CDATA[I was viewing my blog today and noticed the tag cloud on my sidebar. The most prominent tags are &#8220;SharePoint&#8221;, &#8220;Developers&#8221;, and &#8220;Administrators&#8221;. SharePoint. Developers. Administrators. From time to time, I will meet SharePoint professionals in networking events or when interviewing job applicants at a customer site and I will ask what their SharePoint experience [...]]]></description>
			<content:encoded><![CDATA[<p>I was viewing my blog today and noticed the tag cloud on my sidebar. The most prominent tags are &#8220;SharePoint&#8221;, &#8220;Developers&#8221;, and &#8220;Administrators&#8221;. <strong>SharePoint</strong>. <strong>Developers</strong>. <strong>Administrators</strong>.</p>
<p>From time to time, I will meet SharePoint professionals in networking events or when interviewing job applicants at a customer site and I will ask what their SharePoint experience is like. &#8220;Oh I am a <strong>SharePoint Developer</strong>&#8220;. Then I find out that the extent of their development experience revolves around master-page and page-layout design, style/CSS customizations, and graphical/logo design. Basically, branding tasks. And then there is the &#8220;<strong>SharePoint Administrator</strong>&#8220;. &#8220;Oh, I am the site collection administrator and manage user-permissions, site-collection features, and sometimes recycle items for end-users from the Recycling Bin.&#8221;</p>
<p>I think people are calling themselves SharePoint Developer more than they should. In my opinion, a SharePoint developer is someone who can develop Web parts, workflows, user-controls, Web controls, ASPX pages, client-side scripting, and complete SharePoint solutions. In addition, they also understand deployment options such as creating solution packages. If your experience around SharePoint is limited to CSS, branding, and design stuff, you&#8217;re a <strong>designer</strong>, buddy; not a <strong>developer</strong>, but a <strong>designer</strong>.</p>
<p>Now, let&#8217;s talk about the &#8220;SharePoint Administrator&#8221;. Yes, to a point, the site-collection administrator is an administrator. But to me, and again, this is just my opinion, farm admins are the real SharePoint administrators. To call yourself a SharePoint administrator, especially on job interviews, you better know your SharePoint deployment scenarios, Central Admin, SharePoint disaster/recovery procedures, IIS, SQL Server, Windows Server OS, and the beloved &#8220;stsadm&#8221; command.</p>
<p>Sometimes I will encounter resumes where the job applicant puts &#8220;<strong>SharePoint Developer</strong>&#8221; or &#8220;<strong>SharePoint Administrator</strong>&#8221; in their work history but nothing in the roles and responsibilities indicate the degree of technical expertise required to be called a &#8220;real SharePoint Developer&#8221; or a &#8220;real SharePoint Administrator&#8221;! </p>
<p>The point I&#8217;m trying to make is please, please, please&#8211;do not inflate your work experience, especially when applying for jobs. You might fool the recruiters but you&#8217;re not going to fool the technical leads. Please be honest in your resumes because people will catch you if you think the inflated titles will make you a better candidate for a job.</p>
<p>Honesty people!</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2010/04/sharepoint-developers-and-administrators/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read the Manifest File from a Sharepoint Package</title>
		<link>http://spdeveloper.net/2010/03/read-the-manifest-file-from-a-sharepoint-package/</link>
		<comments>http://spdeveloper.net/2010/03/read-the-manifest-file-from-a-sharepoint-package/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 14:39:06 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[Operations]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Deployment]]></category>
		<category><![CDATA[Administrators]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=202</guid>
		<description><![CDATA[I was in a SharePoint governance meeting at one of my customer sites yesterday and the group is thinking of enforcing some rules as far as SharePoint solution packages go. I kept saying during the meeting &#8220;Inspect the manifest file so that you can view what files are going to be installed on the server and where they [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a SharePoint governance meeting at one of my customer sites yesterday and the group is thinking of enforcing some rules as far as SharePoint solution packages go. I kept saying during the meeting &#8220;Inspect the manifest file so that you can view what files are going to be installed on the server and where they are going to get installed&#8221;. One of the network engineers asked <strong>&#8220;How do you read a manifest file given a WSP</strong>?&#8221; This is probably common knowledge to people who are SharePoint veterans. But if you didn&#8217;t know how it&#8217;s done, here&#8217;s how:</p>
<ol>
<li>Rename the <strong>wsp</strong> file to a .<strong>cab</strong> file</li>
<li>Open up the .cab file (used to be wsp) in WinZIP or something that can open a CAB file.</li>
<li>You can either: a)  extract all files in the cab file and open up the extracted manifest.xml; or b) look for manifest.xml in WinZIP and just extract that one single file.</li>
<li>Open up manifest.xml in notepad, Internet Explorer, or your preferred XML file viewer.</li>
</ol>
<p>That&#8217;s it!</p>
<p>Several of my upcoming posts will be on how to create solution packages. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2010/03/read-the-manifest-file-from-a-sharepoint-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dispose SharePoint Objects Correctly</title>
		<link>http://spdeveloper.net/2010/03/dispose-sharepoint-objects-correctly/</link>
		<comments>http://spdeveloper.net/2010/03/dispose-sharepoint-objects-correctly/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 22:01:33 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=180</guid>
		<description><![CDATA[In the world of managed-code, the garbage-collector typically clears objects in memory automatically for you. Remember malloc() and free() in C++? In managed code, you just typically write &#8220;variable = new Object()&#8221; and the CLR will allocate the memory for you. In unmanaged world like C++, you had to allocated memory and then deallocate memory [...]]]></description>
			<content:encoded><![CDATA[<p>In the world of managed-code, the garbage-collector typically clears objects in memory automatically for you. Remember malloc() and free() in C++? In managed code, you just typically write &#8220;variable = new Object()&#8221; and the CLR will allocate the memory for you. In unmanaged world like C++, you had to allocated memory and then deallocate memory after use.</p>
<p>Most objects in ASP.NET Framework are allocated/deallocated in memory automatically. However, there are objects that inherit from the <strong>IDisposable. You have to explicitly dispose objects that implement the IDisposable interface or you will run the risk of memory leaks.</strong> Some examples of ASP.NET objects that implement IDisposable include Connection, Command, Adapater, and Reader objects (in the System.Data namespace). You can perform any of the following to dispose these objects properly:</p>
<pre class="brush: csharp;">

SQLConnection connection = new SQLConnection(connectionString);

//use the connection object here

connection.Dispose();
</pre>
<p> </p>
<p>Or, you can using the <strong><em>using </em></strong>statement:</p>
<pre class="brush: csharp;">

using(SQLConnection connection = new SQLConnection(connectionString))

{

                //use connection object here

} // don't have to call Dispose(); the using statement will dispose connection correctly
</pre>
<p>When working with SharePoint API (SharePoint .NET libraries and not the SharePoint Web services), <strong>it is important to know when and when not to dispose SharePoint objects.</strong> If you do not dispose objects in SharePoint, your server will run the risk of memory leaks which can lead to performance issues. If you dispose objects that you&#8217;re not supposed to call Dispose() on, you might inadvertently kill the SharePoint application! For example, the following code will definitely kill the SharePoint Web application:</p>
<pre class="brush: csharp;">

SPContext.Current.Web.Dispose(); // expect calls to your help-desk with this line in your code!
</pre>
<p> </p>
<p>If you are the custodian of the SharePoint farm, you might want to use the <strong><a href="http://code.msdn.microsoft.com/SPDisposeCheck">SP Dispose Checker Tool</a></strong> to ensure that the custom .NET assemblies being installed on your farm will not cause memory leaks.</p>
<p>For complete guidance on when and how to dispose SharePoint objects, you can read the <a href="http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx">SP Dispose Team blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2010/03/dispose-sharepoint-objects-correctly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customizing WSP files using VSeWSS 1.3 in Visual Studio 2008</title>
		<link>http://spdeveloper.net/2009/12/editing-wsp-file-using-vsewss-1-3-in-visual-studio-2008/</link>
		<comments>http://spdeveloper.net/2009/12/editing-wsp-file-using-vsewss-1-3-in-visual-studio-2008/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 21:35:25 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Deployment]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Parts]]></category>
		<category><![CDATA[WSP]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=154</guid>
		<description><![CDATA[Using VSeWSS 1.3 with Visual Studio 2008, when you create a new Web Part project, you can edit the Web part properties and descriptions using the WSP View. The typical Solution Explorer in VS 2008 looks like the following when working on a Web part project: In order to see the manifest.xml or feature.xml file, [...]]]></description>
			<content:encoded><![CDATA[<p>Using <strong>VSeWSS 1.3</strong> with Visual Studio 2008, when you create a new Web Part project, you can edit the Web part properties and descriptions using the WSP View. The typical Solution Explorer in VS 2008 looks like the following when working on a Web part project:</p>
<div id="attachment_155" class="wp-caption aligncenter" style="width: 291px"><img class="size-full wp-image-155" title="Solution Explorer in VS 2008" src="http://spdeveloper.net/wp-content/uploads/2009/12/solution-explorer.png" alt="Solution Explorer in VS 2008" width="281" height="216" /><p class="wp-caption-text">Solution Explorer in VS 2008</p></div>
<p>In order to see the manifest.xml or feature.xml file, you have to look at the &#8220;<strong><em>WSP View</em></strong>&#8220;. WSP View can be accessed by going to the menu and hitting <em>View&#8211;&gt;Other Windows&#8211;&gt;WSP View</em>. The WSP View looks like the following:</p>
<div id="attachment_156" class="wp-caption aligncenter" style="width: 293px"><img class="size-full wp-image-156" title="WSP View" src="http://spdeveloper.net/wp-content/uploads/2009/12/wsp-view.png" alt="WSP View" width="283" height="287" /><p class="wp-caption-text">WSP View</p></div>
<p>The <strong>manifest.xml</strong> file doesn&#8217;t contain &#8220;product description&#8221; type information. The <strong>manifest.xml</strong> contains assemblies and features information. The <strong>feature.xml</strong> file, that on the other hand, start containing &#8220;description&#8221; type data. Here&#8217;s what the feature.xml contents typically look like:</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;Feature Id=&quot;cfc5cfdd-62cf-4d98-aeba-e1b38ec6f64f&quot;

             Title=&quot;HelloPart&quot;

             Description=&quot;A Web part that wants to say hello to you.&quot;

             Scope=&quot;Site&quot; Version=&quot;1.0.0.0&quot; Hidden=&quot;FALSE&quot;

             DefaultResourceFile=&quot;core&quot; xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;

  &lt;ElementManifests&gt;

    &lt;ElementManifest Location=&quot;HelloPart\HelloPart.xml&quot; /&gt;

    &lt;ElementFile Location=&quot;HelloPart\HelloPart.webpart&quot; /&gt;

  &lt;/ElementManifests&gt;

&lt;/Feature&gt;
</pre>
<p>See that <em><strong>Title</strong></em> and <em><strong>Description</strong></em> attributes inside the Feature element? They will get displayed in the Site Features Gallery: </p>
<div id="attachment_159" class="wp-caption aligncenter" style="width: 512px"><img class="size-full wp-image-159 " title="WP Title and Description in the Features Gallery" src="http://spdeveloper.net/wp-content/uploads/2009/12/features-gallery.png" alt="WP Title and Description in the Features Gallery" width="502" height="248" /><p class="wp-caption-text">WP Title and Description in the Features Gallery</p></div>
<p>What about the <strong>Web part file</strong> (in the example I&#8217;m using above, the filename is HelloPart.webpart)? What information can be customized and modified here? First, let&#8217;s take a look at the contents of the webpart file:</p>
<pre class="brush: xml;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;webParts&gt;

  &lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&gt;

    &lt;metaData&gt;

      &lt;!--

      The following Guid is used as a reference to the web part class,

      and it will be automatically replaced with actual type name at deployment time.

      --&gt;

      &lt;type name=&quot;247ef4d4-489d-46d1-a628-8d8daa6267a3&quot; /&gt;

      &lt;importErrorMessage&gt;Cannot import HelloPart Web Part.&lt;/importErrorMessage&gt;

    &lt;/metaData&gt;

    &lt;data&gt;

      &lt;properties&gt;

        &lt;property name=&quot;Title&quot; type=&quot;string&quot;&gt;Gabe's Hello Web Part&lt;/property&gt;

        &lt;property name=&quot;Description&quot; type=&quot;string&quot;&gt;HelloPart is a user-friendly Web part....&lt;/property&gt;

      &lt;/properties&gt;

    &lt;/data&gt;

  &lt;/webPart&gt;

&lt;/webParts&gt;
</pre>
<p>Inside <em>webPart&#8211;&gt;data&#8211;&gt;properties</em> section, there are <em>property</em> elements. The first one is the &#8220;<strong><em>Title</em></strong>&#8221; and the other is the &#8220;<strong><em>Description</em></strong>&#8220;. The values for &#8220;Title&#8221; and &#8220;Description&#8221; contained in the webpart file are what gets displayed in the Web part catalog:</p>
<p> </p>
<div id="attachment_162" class="wp-caption aligncenter" style="width: 519px"><img class="size-full wp-image-162  " title="WP Title and Desription in the WP Catalog" src="http://spdeveloper.net/wp-content/uploads/2009/12/add-web-parts.png" alt="WP Title and Desription in the WP Catalog" width="509" height="509" /><p class="wp-caption-text">WP Title and Desription in the WP Catalog</p></div>
<p>Finally, let&#8217;s take a look at the <strong>Web part XML file</strong> (in the example I used above, the filename is HelloPart.xml). The Web part XML file contains the following:</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;Elements Id=&quot;247ef4d4-489d-46d1-a628-8d8daa6267a3&quot; xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot; &gt;

  &lt;Module Name=&quot;WebParts&quot; List=&quot;113&quot; Url=&quot;_catalogs/wp&quot;&gt;

    &lt;File Path=&quot;HelloPart.webpart&quot; Url=&quot;HelloPart.webpart&quot; Type=&quot;GhostableInLibrary&quot; /&gt;

  &lt;/Module&gt;

&lt;/Elements&gt;
</pre>
<p>See how the <em>File</em> element doesn&#8217;t have any children? We can put a <em>Property</em> element as a child of the <em>File</em> element. This <em>Property</em> element will contain the &#8220;<strong><em>Group</em></strong>&#8221; the Web part appears in the catalog. By default, like the in the Web part XML file example above, the Group is not specified and therefore, the Web part gets listed under <em>Miscellaneous Group</em> in the Web Part catalog. If you want the Web part to appear in a group other than <em>Miscellaneous</em>, transform the Web part XML file from the above example to the following:</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;

&lt;Elements Id=&quot;247ef4d4-489d-46d1-a628-8d8daa6267a3&quot; xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot; &gt;

  &lt;Module Name=&quot;WebParts&quot; List=&quot;113&quot; Url=&quot;_catalogs/wp&quot;&gt;

        &lt;File Path=&quot;HelloPart.webpart&quot; Url=&quot;HelloPart.webpart&quot; Type=&quot;GhostableInLibrary&quot;&gt;

              &lt;Property Name=&quot;Group&quot; Value=&quot;My Stuff&quot;/&gt;

        &lt;/File&gt;

  &lt;/Module&gt;

&lt;/Elements&gt;
</pre>
<p>We added the <em>Property</em> element below the <em>File </em>element. The <em>Name </em>attribute of the <em>Property</em> element should have a value of &#8220;<strong><em>Group</em></strong>&#8221; and the <em>Value</em> attribute is the group name you want the Web part to appear in the catalog. In the example above, after the Web part gets deployed, the Web part appears in a category called &#8220;<em>My Stuff</em>&#8220;:</p>
<div id="attachment_168" class="wp-caption aligncenter" style="width: 512px"><img class="size-full wp-image-168 " title="Web Part appearing on specified Group" src="http://spdeveloper.net/wp-content/uploads/2009/12/web-part-grouped.png" alt="Web Part appearing on specified Group" width="502" height="502" /><p class="wp-caption-text">Web Part appearing on specified Group</p></div>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2009/12/editing-wsp-file-using-vsewss-1-3-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Programmatically Check the Web Part State</title>
		<link>http://spdeveloper.net/2009/12/programmatically-check-the-web-part-state/</link>
		<comments>http://spdeveloper.net/2009/12/programmatically-check-the-web-part-state/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 15:33:52 +0000</pubDate>
		<dc:creator>Gabe Hilado</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spdeveloper.net/?p=142</guid>
		<description><![CDATA[A Web part goes through different states when it gets added to a Web part page. When you first put a Web part on a SharePoint page, you’re typically in “design mode”, where you can modify the Web part properties. After you’re done editing, the SharePoint page and the Web part goes into “browse mode”. You [...]]]></description>
			<content:encoded><![CDATA[<p>A Web part goes through different states when it gets added to a Web part page. When you first put a Web part on a SharePoint page, you’re typically in “design mode”, where you can modify the Web part properties. After you’re done editing, the SharePoint page and the Web part goes into “browse mode”. You can also preview the Web part in the site collection’s Web part gallery. And don’t forget, SharePoint Designer can also render the Web part in SP Designer’s page editor (Design window).</p>
<p>If you are developing Web parts, you will want to be able to check the state the Web part is in so that you can render content (controls and literals) appropriately. So, how do you check the different states of the Web part? You can check using the following:</p>
<p>(*<strong><span style="text-decoration: underline;">Note</span></strong>: &#8220;<strong><em>this</em></strong>&#8221; that you see below is a reference to the Web part class. In other words, the expressions listed below are applicable only when inside the Web part class code.)</p>
<ul>
<li><strong>WebPartManager.GetCurrentWebPartManager(this.Page).DisplayMode.Name</strong> &#8211; this property is a string with the following possible values:
<ul>
<li><em>Catalog</em> &#8211; this is the value of DisplayMode property when a user initiates the &#8221;edit page&#8221; command on a Web part page.</li>
<li><em>Edit</em> &#8211; this is the value of DisplayMode property when the user initiates modifying the Web part.</li>
<li><em>Design</em> &#8211; this is the value after the OK button is clicked on the Tool Pane (after editing the Web part properties in a Web part page).</li>
<li><em>Browse</em> &#8211; browsing the Web part in a normal fashion.</li>
</ul>
</li>
<li><strong>this.DesignMode</strong> &#8211; the value is <em>true</em> when editing the Web part page containing the Web part is being edited in SharePoint Designer.</li>
<li><strong>this.IsStandalone</strong> &#8211; the value is <em>true</em> when the Web part is not contained in a Web part zone. This is typically true when you&#8217;re viewing the Web part in preview mode in the site collection Web part gallery.</li>
<li><strong>WebPartManager.GetCurrentWebPartManager(this.Page)</strong>  &#8211; the object returned by this method will be null when the Web part is being previewed (in the site collection Web part gallery)</li>
</ul>
<p>Checking the state of the Web part is useful when deciding what to render. For example, during regular browsing mode, the Web part will render the normal Web part contents. But if the Web part is being rendered in SharePoint Designer, you might want the Web part to render a &#8220;Preview command button&#8221; (the way invisble controls like the AJAX ScriptManager or ObjectDataSource look in layout/design editors).</p>
]]></content:encoded>
			<wfw:commentRss>http://spdeveloper.net/2009/12/programmatically-check-the-web-part-state/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

