SmartPart for SharePoint Version 1.0.0.0 Released

Finally I’ve managed to finish a new release for the SmartPart for SharePoint; version 1.0.0.0. This release has some really cool new features, but I'm really excited about the first one: connectable web parts with ASP.NET user controls!

  • Create connectable web parts
    In SharePoint you can connect web parts, so they can exchange data. For example you could create a web part that displays a list of invoices, and another web part that displays the details of the selected invoice (master/detail view). Normally you’d have to create your Invoice and InvoiceDetails web parts by hand, implementing the ICellProvider and ICellConsumer interfaces (see Patrick’s excellent article about this topic). With the new version of the SmartPart you can do the same, but instead of coding everything by hand, you can create ASP.NET user controls! Just implement the ICellProviderUserControl or ICellConsumerUserControl on your user control, and you’re done.
  • CAS Optimization
    Maxim Karpov did a great job on fine-tuning the Code Access Security for the SmartPart. For running the previous versions of the SmartPart, you’d had to increase the trust level in the web.config to WSS_Medium. In this version this is not required anymore. Of course if your user controls require a higher trust level, you can raise the trust level as usual.
  • Hiding the user control selection
    Once you’re finished building your user controls, maybe you’d want to ship the finished web parts/user controls to a customer for example. In that case you don’t want the user to select the user controls from the dropdown listbox of the SmartPart, or filling out the user control name by hand. With the new version of the SmartPart you can create a DWP file which contains all the settings for an instance of the SmartPart showing a specific user control. The nice part is that you can hide the dropdown listbox or textbox for selecting the user control by adding the following node in the DWP after you’ve exported an instance of the SmarPart: <ShowUserControlList xmlns="SmartPart">false</ShowUserControlList>.

You can download the latest version from the Releases section on the GotDotNet Workspace. In the coming days I’ll create an example for each of the new features. Additionally keep an eye on Maxim’s blog, he has promised a post about the CAS issues. Also make sure you’ve read Readme file before deploying the SmartPart, since you now have two deployment scenarios (in the GAC or not). Of course if you have any comments, problems, questions, … let me know!

23 Comments

  • Proud of you! Good job! May the force be with you!

  • Great stuff Jan, ill be sure to check it out !

  • That's it. I'm throwing away our implementation of the &quot;UserControlHost&quot;.. SmartPart is the way. Great work guys!

  • Jan, should this go into the &quot;Free WSS Web Parts&quot; section (08.xx) part of the WSS FAQ's section VII or the &quot;Free WSS-relevant programs&quot; section (10.xx)?

  • Jan, should this go into the &quot;Free WSS Web Parts&quot; section (08.xx) part of the WSS FAQ's section VII or the &quot;Free WSS-relevant programs&quot; section (10.xx)?

  • Nice work Jan. :-)

  • Congratulations Jan, seriously good work...

  • I might miss something but I cannot find the source code on GotDotNet. Any clues?

  • I can't download the smartpart! i cannot find it anymore at gotdotnet, is it moved?



    thanks

  • I can load the WebPart on a page, but when I then click on it, I get errors that say:



    Error: unable to load ~\UserControls\DropDownNavigation.ascx

    Details: Parser Error: Could not load type 'DropDownNavigation.DropDownNavigation'



    Sorry to be so thick about this...

  • I got the same error as Tom has. In my situation I get this error when I deploy the application to another site as the main site.

    On the main site it works. When you have more than 1 sites on a server it seems that I get that error. Any suggestions? Perhaps some kind of hard-coded paths?

  • I too am having the same issue as Angelo and Tom but it's for a custom user control on a single server with multiple portals.



    The setup is 2 porals and the default website on 1 server. I ended up putting my assembly in c:\inetpub\wwwroot\bin even though my test portal is at d:\wwwroot\sppstest and have the control in d:\wwwroot\sppstest\usercontrols\mycontrol.ascx. When I try to set the location in the SmartPart to ~\UserControls\mycontrol.ascx and apply, I get 'Parser Error: Could not load type mycontrol.mycontrol'.



    Is this because of my setup, like Angelo suggests?



    Thanks,

    Roger

  • Im not convinced, the whole thing is pretty confusing if you are just following the directions right out of the installation package. Wont load type errors abound

  • Parser Error:

    There are lots of discussions about the Parser Error and no fixes, it could be because the problem seems to appear for no apperent reason and sometimes can be fixed with a simple iisreset.

    I ran into this issue after the server had a problem connecting to a backend SQL server. I tried everything to resolve it and finally just ran an iisreset and the problem went away? Took me 2 hours to try the iisreset because it is a production server and I was leary to do it during work hours, but it solved the problem.

  • Has Anyone also tryed to instance and use a SQL connection and display items into a simple DataGrid?

  • I have been using SmartPart for about a week now, but have run into an issue that I can't solve. I need to read an XML file in the user control that the SmartPart is using, but for some reason the SmartPart can't access the xml file. I have tried installing the SmartPart in the GAC and I am creating the path to the XML file dynamically relative to the location of the user control. I have tried copying it to UserControls, wpresources, and bin with no luck. What is the secret to accessing a file?

  • Hi
    when i tried installing Smartpart 1.0.0.0 i encountered an error. The log file shows following message

    "Error while installing from smartpart for sharepoint 1.0.0.0" .Invalid virtual server'someservername'.
    The server instance specified was not found.Unable to install package to any virtual servers

  • Thanks for the great work, Jan! I'm trying to evaluate the possibilities of using SmartPartv3 and what limitations we might need to consider. I get an error when I try to have SmartPart host a ReportViewer control. Why is this, and are there other ASP.NET 2.0 controls that it has difficulty hosting? Thanks in advance!

  • Lucy! Please call me,Lucy! Please call me

  • Hi My Name Is ivanxm.

  • i take now a course with Mr jan ,

    thanx man very much u r a great man really

  • HI,
    I have tried installing SmartPart 1.1.0.0.
    As read in an article it needs to go through 2 steps (asking if to install in Virtual directories and Reg CAS). But for me it did not ask for both. I checked in Add/Remove Programs and confirmed that it has got installed. But i'm not able to locate the SmartPart webpart in the WebPartGallery/AddWebPart List.
    Could you please help me on this?

  • is there a way i can remove the dropdownlist feature (for selecting .ascx files) from the smartpart 1.0 and put the text box control ( and type ~/UserControls/filename.ascx)

    This is because I don't want to show all my usercontrols to sub level site admins. I am administrating a sharepoint portal which have more than 25,000 user base.

Comments have been disabled for this content.