Son of SmartPart v1.0#

Jan Tielens did it again!   Son of SmartPart version 1.0 for WSS on ASP.Net 2.0 supporting UserControls and ASP.Net 2.0 WebParts. Great work!

Here’s some good news for everybody that has been waiting for it: I’ve just uploaded the brand new Son of SmartPart to the GotDotNet site! First of all, what is the Son of SmartPart? This version of the SmartPart will allow you to run ASP.NET 2.0 Web User Controls and ASP.NET 2.0 Web Parts in SharePoint sites. Since WSS SP2 you can run your SharePoint sites on the .NET Framework version 2.0, and from now on you can use the power of the new platform to extend SharePoint.

What is working and what is not?
Not all features that I would like to be in v1.0 are available yet, so what is already working and what’s not? The Son of SmartPart (SOSP) comes in two flavours: one to run ASP.NET 2.0 User Controls (SOSP-UC) and one to run ASP.NET 2.0 Web Parts (SOSP-WP). For the SOSP-UC version, all the features from the previous version of the SmartPart are working, so you can expose custom properties, toolparts, create connectable web parts and so on. The SOSP-WP version only has the basic functionality to run ASP.NET 2.0 web parts. Advanced stuff like connections are not yet supported. Support for these advanced features will follow.

How do you install it?
If you download the release from the GotDotNet site, you will find an Installation Guide. I’ve also created a
small screencast to guide you to this process. There is no automated installation yet because the current version of the deployment tools (STSADM and WPPackager) do not support .NET 2.0 assemblies (yet?).

What's next?
This is not the last release of the Son Of SmartPart! I'd love to hear your feedback so we can make the coming releases even better. For now: go get the latest version on
http://www.smartpart.info and unleash the power of ASP.NET 2.0 on your SharePoint sites!

Together with this, Jan also wrote an article with a Quickstart for SmartPart, showing how to create ASP.Net 2.0 UserControls and show it in SharePoint.

This article will show you how you can create your first .NET 2.0 user control and show it in a SharePoint site. First you need to deploy the Son of SmartPart to your SharePoint server of course. Check the Installation Guide which you can find in the zip file that can be downloaded from www.smartpart.info, or watch this installation screencast. When this is done, open up your brand new Visual Studio 2005 and create a new ASP.NET Website. In the Website menu choose “Add new item”, and add a new Web User Control to the project, named DemoControl.asxc.

Now let’s implement the desired functionality! Drag-and-drop a Calendar control from your toolbox on the newly created Web User Control. You can do this both in design and source view, but in the source view you immediately see the result. You can use the SmartTag to Auto Format the control, I’ve selected the professional look of course. :-)

It’s time to write some code so switch to code view, and in the Page_Load event write following code:

public partial class DemoControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Calendar1.Width = new Unit("100%");
        Calendar1.SelectionMode = CalendarSelectionMode.None;
        Calendar1.TodaysDate = DateTime.Now;
    }
}

Optionally you can test your user control by putting it on your default.aspx page for example. But lets immediately fast forward to the deployment of your work to SharePoint. Open the folder in which your web site is located (typically \My Documents\Visual Studio 2005\WebSites\NameOfSite) and copy DemoControl.ascx and DemoControl.ascx.cs to the \UserControls folder of your SharePoint site (check the installation guide if you don’t know what I’m talking about). Next you can open the SharePoint site where you’d like to add the user control as a web part. On the top right of the page, click “Modify Shared Page”, “Add Web Parts”, “Browse” and drag-and-drop an instance of the SonOfSmartPart UC web part to your page.

Click the “Open the tool pane” link on the SmartPart and select the “usercontrols_democontrol_ascx” from the top drop down. Additionally you can also choose a title for your web part. When you’re done click the OK button at the bottom of the page. Now you’re ASP.NET 2.0 UserControl is displayed in a SharePoint site!

Tuesday, November 22, 2005 7:08:26 AM UTC #     | 

 

All content © 2012, Mart Muller
On this page
This site
Calendar
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Archives
Sitemap
Disclaimer

Powered by: newtelligence dasBlog 1.9.7174.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts