Posted by: Gabe Hilado in SharePoint on July 9th, 2011

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)
   {
      if (string.IsNullOrEmpty(SelectedListName))
      {
            placeHolderLiteral.Text = "
Web part is not configured. Please <a href="\&quot;javascript:MSOTlPn_ShowToolPane2Wrapper('Edit',">edit the Web part</a> and choose a list or library.

";
      }
   }
}

In the example above, I render a “please configure the Web part” message whenever the SelectedListName of the Web part is not set.

I’m currently developing a Web part for SharePoint 2010 and I wanted to have a “configure” 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 MSOTlPn_ShowToolPane2Wrapper. It didn’t work!

So, thinking like a developer, I observe how the out-of-the-box Web parts render an “open tool pane” hyperlink. I add an Image Viewer web part to a web part page and look at the structure of the hyperlink. Here’s what I saw:

ShowToolPane2Wrapper function
I replaced my output code in my web part class from MSOTlPn_ShowToolPane2Wrapper to ShowToolPane2Wrapper and it works!
Please note that I encourage that you put ‘this’ (object) as the second argument instead of ’129′, or ’16′ 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 ’129′ or ’16′? You don’t! So simply use ‘this’.

Bookmark and Share
Posted by: Gabe Hilado in SharePoint on May 27th, 2011

When you’re trying to create a Search Center site in SharePoint 2010, you get an error that looks like the following:
Unexpected Error When Creating Search Center

You have to activate SharePoint Server Publishing Infrastructure in Site Collection Features in order to create Search Center sites:

Enable SharePoint Server Publishing Infrastructure

Bookmark and Share
Posted by: Gabe Hilado in Security on May 26th, 2011

When I was configuring SharePoint 2010 in Windows 2008 R2 to use Kerberos, I bumped into this Technet article, which discusses configuration of Kerberos for SharePoint 2010.

http://technet.microsoft.com/en-us/library/ee806870.aspx

In the article, it advises to verify that Kerberos is used by looking at the Security event log and looking for Event 540. Well, event 540 never showed up. It confused the heck out of me. Apparently, event 540 is only for Windows 2003. In Windows 2008 R2, the equivalent of Event 540 is Event 4624. The following article mentions this:

http://www.endusersharepoint.com/EUSP2010/2010/04/21/life-is-just-a-bowl-of-sharepoint-%E2%80%93-part-8-installing-sharepoint-2010-beta-with-kerberos/

Bookmark and Share
« Older PostsNewer Posts »