Geeks With Blogs
Andy Johns' Blog Andy's twisted brain....

Ack, it's been a while since I've had a chance to make an entry here, but I've been heads down in a project for a major Santa Clara company....

I've got a stack of tips and techniques to share, but I'll be doling them out slowly as I have a chance to recode them. (Most of my blog code ideas come from client work. However to avoid any IP or NDA issues, I recode all code samples on my own time, with my own machine before posting them here.)

Ok, so here's the tip for today.... You know how when you add an out-of-the-box web part that requires configuration you get a nice little message in the web part display that you need to configure it, and a link to open up the toolpane? Add a Page Viewer web part to your site and you'll see what I mean.... Well here's how to add one of those links. This is really useful in exception handling for configuration related exceptions too....

In your RenderWebPart override check to see if your part is configured, if not output something like this:

output.Write(@"Web Part not configured: <a target=""_self"" href=""javascript:MSOTlPn_ShowToolPaneWrapper('1','129','g_" + this.StorageKey.ToString.Replace("-"c, "_"c) + @"');"" target=""_self"">click here</a> to configure<br>");

Pretty darn simple huh?

-Andy

 

Posted on Tuesday, March 30, 2004 12:51 PM | Back to top


Comments on this post: Sharepoint tip - Configuration Toolpane link

# re: Sharepoint tip - Configuration Toolpane link
Requesting Gravatar...
AWESOME! Thank you so much for posting this!
Left by Mike-EEE on Jul 19, 2004 5:22 PM

# re: Sharepoint tip - Configuration Toolpane link
Requesting Gravatar...
Here's what I use:

// no url was entered, so add a link to the property page
LiteralControl literalControl = new LiteralControl(string.Format("To link to content, <a href=\"javascript:MSOTlPn_ShowToolPaneWrapper('{0}','{1}','{2}');\">open the tool pane</a> and then type a URL in the <b>Link</b> text box.", 1, 129, this.ID));
literalControl.RenderControl(output);
Left by Kevin on Apr 28, 2005 12:33 PM

# re: Sharepoint tip - Configuration Toolpane link
Requesting Gravatar...
Thanks Dude
Left by Tsjaar on May 09, 2005 5:37 AM

# re: Sharepoint tip - Configuration Toolpane link
Requesting Gravatar...
hi,
I have acontent editor with content, is ther apossibilty to add this line, so the when the users want to edit the text, they just need to click th link?
Left by Ariel on Jul 10, 2005 3:55 AM

# re: Sharepoint tip - Configuration Toolpane link
Requesting Gravatar...
The following works too:

<a href=javascript:MSOTlPn_ShowToolPane2Wrapper('Edit',this,'" + this.ID + "');>toolpane
Left by Ben de Vaal on Dec 15, 2008 5:49 AM

# Cheap brooches wholesale,buy fashion cheap brooches online
Requesting Gravatar...
hi,
I have acontent editor with content, is ther apossibilty to add this line, so the when the users want to edit the text, they just need to click th link?
Left by Ariel on Jul 10, 2005 3:55 AM
Left by clothing suppliers wholesale on Mar 23, 2011 8:52 PM

Your comment:
 (will show your gravatar)


Copyright © Andy Johns | Powered by: GeeksWithBlogs.net