Thursday, June 10, 2004 10:10 PM Jan Tielens

Introducing "SmartPart for SharePoint"

Everyone who has created a webpart for SharePoint, knows that the “developer experience” is not as good as one would expect. You create the webpart in Visual Studio, based on the Webpart Template, but you can’t design the User Interface by drag-and-dropping controls on the webpart. But luckily you can use the “User Control technique” which gives the advantage that you can use the VS.NET UI designer. Patrick Tisseghem has evangelized this technique a lot, check out his article, his posts and the video. Fons Sonnema has written an article about how you can create and use a generic webpart that can host an ASP.NET User Control. I’ve extended this webpart with some extra functionality; let me introduce you to the SmartPart for SharePoint!

The SmartPart is a generic webpart that can contain an ASP.NET user control. Nothing new you would say, but the SmartPart can give your user control access to the SharePoint object model. So from within the code of the User Control you can do stuff with SharePoint! Another feature is that the user control can expose some properties which the SmartPart picks up, so the user can specify values for these properties in the SharePoint site. To prove you how easy it is, I’ve create a small demo. In this demo I will create a DropDownNavigation webpart in less than 5 minutes (it could be less, but I made some typos). The webpart will show a dropdown list in which the subsites of a SharePoint site are displayed. When a site is selected from the list, the user will be redirected to that site. Here’s the video.

First I create a new ASP.NET Web Application solution in Visual Studio.NET. Then I add a new Web User Control to the project. If you want to use the SharePoint object model, you need to add references to the SmartPart assembly and the SharePoint assembly. Next I add some code. When I’m done, I build the project (actually I try to build it, correct a mistake and build again). To be able to use the user control in SharePoint, I copy the assembly to the \BIN folder of my SharePoint site, and the .ASCX file to a newly created \UserControls folder. Finally I show how you can use the SmartPart webpart in SharePoint to load the newly created User Control.

Together with Fons, I’ve created a GotDotNet Workspace for the SmartPart. Over there you can download an installation package that will install the SmartPart, the source code and an example user control. At this point there isn’t very much documentation, but I will work on that. :-) There are a lot of cool ideas which (I hope) will be added to the SmartPart (for example a connectable SmartPart). I’ve IM-ed with Patrick today and he has another cool idea which he discussed in one of his latest posts: using the User Interface Process block together with web parts. Anyway, some nice ideas are waiting to be implemented!

Filed under:

Comments

# SmartPart for SharePoint

Thursday, June 10, 2004 1:17 PM by TrackBack

Now Fons and Jan Tielens, have improved on the this with the SmartPart for SharePoint ...

# re: Introducing "SmartPart for SharePoint"

Thursday, June 10, 2004 5:13 PM by Tom van de Kerkhof

Jan, you did a great job! It's way too cool! It's just so easy to hook up your ASP.NET user control with the smartpart. Just what we need! Now make them connectable! ;-)
Again, Wow!

# re: Introducing "SmartPart for SharePoint"

Thursday, June 10, 2004 5:17 PM by Fons Sonnemans

Wow, video. Great man!

# re: Introducing "SmartPart for SharePoint"

Thursday, June 10, 2004 6:04 PM by Bil Simser

What a great way to use .NET and SharePoint! I put an entry in my blog about this as well. Great work you two!

# Was gibt es Neues im SharePoint-Universum ?

Friday, June 11, 2004 12:35 AM by TrackBack

Ok, es tut sich mal wieder viel im SharePoint-Universum.

# Was gibt es Neues im SharePoint-Universum ?

Friday, June 11, 2004 12:38 AM by TrackBack

Ok, es tut sich mal wieder viel im SharePoint-Universum.

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 3:50 AM by Martyn Johnson

Great idea. Looking at the video, I only wish my laptop was just as quick at creating visual studio projects!!

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 3:55 AM by M. de Groot

You guys are amazing! This is what we have been waiting for. While we where waiting, you just developed it! Great solution to a huge problem.

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 4:20 AM by Scott Leslie

Nice tool here...

added to my blog

# Developing WebParts with UserControls

Friday, June 11, 2004 7:35 AM by TrackBack

# Developing WebParts with UserControls

Friday, June 11, 2004 7:35 AM by TrackBack

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 8:27 AM by Thomas Caffrey

Is there anyway you could create an installer for the DropDownNavigation WebPart like you did for the Lead-It Navigation? That would be very helpfull, thank you.

# Smartpart for SharePoint

Friday, June 11, 2004 12:33 PM by TrackBack

Jan is just too cool!! Just as I am getting over my ecstasy with what he had created with Workflow Lite - now he has come out with Smartpart. This guy should really get a HUGE award for all the great work he is doing in the SharePoint community. I can't stress how impressed I am. Great work again Jan! I have been working very steadily with SharePoint for about 2 years now and I absolutely love it. I love what it does for me today and even more so I love it's potential. Aside from the power given to the information worker (which is tremendous), what really makes SharePoint scream are the web parts, tools and add-ons that developers like Jan come up with that extend the platform....

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 3:20 PM by Eric Legault [Outlook MVP]

Jan, you are doing some AMAZING work with SharePoint. I am positively in awe of all the cool stuff that's coming out of your mind. Rock on!

# re: Introducing "SmartPart for SharePoint"

Friday, June 11, 2004 4:16 PM by Dennis

Just great, nothing more to say...

# SharePoint Portal Server gaining traction

Sunday, June 13, 2004 3:13 AM by TrackBack

# A little

Sunday, June 13, 2004 12:23 PM by TrackBack

# SharePoint Treeview Webpart

Sunday, June 13, 2004 3:27 PM by TrackBack

I see that Tom van de Kerkhof has created a Treeview Webpart based on Jan and Fons' SmartPart. This is great. It is so exciting to see how many great things are happening right now with SharePoint. It really goes to show how much a difference a community makes to any application or software that is introduced to the market....

# SharePoint, Code Access Security and the SmartPart

Monday, June 14, 2004 5:10 AM by TrackBack

# SmartPart WebPart

Monday, June 14, 2004 6:36 AM by TrackBack

# Whibey

Tuesday, June 15, 2004 5:12 AM by TrackBack

# Cool SharePoint Stuff

Wednesday, June 16, 2004 4:12 AM by TrackBack

# error Can get execution permission

Tuesday, June 22, 2004 2:51 AM by misterdyc

and smartpart shows (c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config line 198)

# re: Introducing "SmartPart for SharePoint"

Wednesday, June 23, 2004 8:14 AM by Poonam Thawani

I am getting the below mentioned error .I have tried couple of times ...Any help will be highly appreciated.
The "UserControlWebpart" Web Part appears to be causing a problem.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily disable Web Parts or remove personal settings. For more information, contact your site administrator.

# Introducing

Sunday, July 11, 2004 9:59 PM by TrackBack

# Good God this is cool

Thursday, July 22, 2004 3:29 PM by Iceman

Cudos to you Jan this is a simple and most effective solution that you have developed. This has saved me weeks of potential hell. I owe you a beer!

Cheers

# re: Introducing "SmartPart for SharePoint"

Friday, August 06, 2004 4:59 PM by Andy Day

Jan. This is great. I would like to incorporate WebPart Caching and Async into the SmartPart. Is there a way to get the latest source code? If not do you have any plans to add these features?

#

Thursday, December 16, 2004 3:08 AM by TrackBack

# re: Introducing "SmartPart for SharePoint"

Thursday, June 29, 2006 8:04 PM by Don

Jan. It is rare when I stop to write a comment so you have earned an award for getting a programmer out of a jam. Your articles have saved me on many occasions. LOL. Your smart webpart navigation article could have saved my organization thousand of dollars. You are an exception programmer.

# re: Introducing "SmartPart for SharePoint"

Wednesday, August 09, 2006 3:05 AM by Susheil

Jan. This is a great tool. Its saved me lots of effort.

I have a question. Is it possible to hide the Smartpart webpart control based on roles?

Thanks in advance

# re: Introducing "SmartPart for SharePoint"

Wednesday, April 04, 2007 6:09 PM by Amy

Hii someone

pls tell me how to reference stylesheet/ javascript file inside Smartpart..

as smartpart does not contain head element, how can I link stylesheet?

Pls pls help me someone

# re: Introducing "SmartPart for SharePoint"

Thursday, May 24, 2007 8:43 AM by Adam Brown

I have successfully developed and deployed the SmartPart Web Part and ascx file, but when I select the control for the Web Part I get the below error on the SharePoint page:

The "SmartPart" Web Part appears to be causing a problem. Input string was not in a correct format.

Any ideas or advice would be much appreciated!

Many thanks

# re: Introducing "SmartPart for SharePoint"

Sunday, September 16, 2007 11:21 PM by Brian

How can I download the smartpart now that gotdotnet is phased out?

# re: Introducing "SmartPart for SharePoint"

Tuesday, October 02, 2007 10:41 AM by Larry

Amy!  

Have you had any luck trying to link a stylesheet with SmartPart?  I'm hitting my against this wall now.

If anyone knows, TELL US!  I'm still on SharePoint 2003 btw.

Thanks!

Larry

# re: Introducing "SmartPart for SharePoint"

Thursday, October 04, 2007 6:30 AM by Moorthy

Hi!

      Can any one tell me the link, where we can download the SmartPart.

# re: Introducing "SmartPart for SharePoint"

Sunday, October 14, 2007 11:27 AM by 1957sojourner

I can't find the SmartPart 1.0.0.0 anywhere; but the newer versions are online at http://www.codeplex.com/

Anyone have a clue how I can download SmartPart 1.0.0.0 -or- which of the newer versions can work in WSS 2.0 SP2 and SharePoint Portal Server 2003??

Thanks in advance.  I appreciate y'alls help.

1957sojourner

1957sojourner@cox.net

# re: Introducing "SmartPart for SharePoint"

Sunday, October 21, 2007 8:36 AM by 1957sojourner

Today, Oct. 21, 2007, eleven unique historical releases of the SmartPart are available for download --www.gotdotnet.com/.../viewuploads.aspx

-- sojo

# re: Introducing "SmartPart for SharePoint"

Monday, October 22, 2007 3:17 AM by prajita

I am getting the below mentioned error while restoring a sharepoint site.I have tried couple of times ...Any help will be highly appreciated.

The "UserControlWebpart" Web Part appears to be causing a problem.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily disable Web Parts or remove personal settings. For more information, contact your site administrator.

# re: Introducing "SmartPart for SharePoint"

Monday, October 22, 2007 11:23 PM by RSmith

When I go to modify the Web Part on a remote server, the Connections options is greyed out. It all works fine locally- any suggestions what could be different on a different box.

# re: Introducing "SmartPart for SharePoint"

Monday, November 19, 2007 5:54 AM by Giannis

Hi,

in Real World SharePoint 2007 book at sample EmployeeGrid you use SmartPart v1.1.0.0 dll and the IConnectionProviderControl method but I can not find it so I use the ICellProviderUserControl which returns error during compiling. Also the side GotDotNet is being phased out.

Do you have any idea what to do.....

# Load UserControl menggunakan SmartPart pada Microsoft Sharepoint « SDR :: Software DevelopeR

Pingback from  Load UserControl menggunakan SmartPart pada Microsoft Sharepoint «  SDR :: Software DevelopeR