Aptillon is born!


Today is an exciting day for myself and my friends Darrin Bishop, Dan Holme, Gary Lapointe, David Mann, Matthew McDermott and Maurice Prather!  Today we launched our new company, Aptillon.  Please head on over to our website to learn all about it.

author: Todd Baginski | posted @ Tuesday, August 24, 2010 10:26 AM | Feedback (1)

Speaking at SharePoint Saturday Denver


In a couple of weeks (August 7, 2010) I’ll be presenting a session at the SharePoint Saturday in Denver, Colorado.

The session title and description follow. Here’s a little glimpse of what you will see in the session; it’s pretty sweet! Come check it out!

You-Tube Application Demo Preview Image

How to Create a YouTube-like Application in SharePoint with the Digital Assets Library and the SharePoint JavaScript Client Object Model

This session demonstrates how to use the new Digital Assets Library and the Videos content type to create YouTube-like functionality in your SharePoint sites. First, the session describes the new functionality the Digital Assets Library provides for videos, images, and audio files. Then the session shows how to create and configure the Digital Assets Library to display a list of videos complete with thumbnail previews. Finally, the session shows how to create a page to watch each video inside a Silverlight video player and display the details about it. All of this great functionality is implemented without writing a single line of managed code; only JavaScript, HTML, and CSS are needed to deliver the functionality!

In case you are wondering, the ski lifts should open in Colorado in 89 days!  Woot!

author: Todd Baginski | posted @ Thursday, July 22, 2010 4:39 PM | Feedback (9)

HOW TO: Create a Sandbox Compatible Visual Web Part with the Visual Studio 2010 SharePoint Power Tools


 

Last week Mike Morton and the folks on the Visual Studio team released the Visual Studio 2010 SharePoint Power Tools.  The Visual Studio 2010 SharePoint Power Toolsextend the SharePoint 2010 project templates and provide the following enhancements.

  1. A sandbox-compatible Visual Web Part item template.
  2. Compile-time validation to ensure your code will run the the sandbox.

This short HOW TO walks you through these features and demonstrates how to make a sandbox compatible Visual Web Part with the Visual Studio 2010 SharePoint Power Tools.

To begin, go download the Visual Studio 2010 SharePoint Power Tools and install them on your SharePoint development machine.  Make sure you have Visual Studio 2010 installed first.  Next, open Visual Studio 2010 and create an Empty SharePoint project.

Empty SharePoint Project

When the SharePoint Customization Wizard prompts you, select Deploy as a sandboxed solution.

Sandboxed Solution

After the project is created, right click the project node and select Add, then select New Item.

New Item

In the Add New Item dialog, select Visual Web Part (Sandboxed), provide a name for the Web Part, and click Add.

Sandboxed Visual Web Part Item

Open the sandbox compatible Visual Web Part’s .ascx file and add some code to create the controls.

<br />
<asp:Label ID="Label2" runat="server" Text="Select a ski resort and click the button to see the best lift."></asp:Label>
<br /><br />
Resorts: 
<asp:DropDownList ID="ResortDropDownList" runat="server">
<asp:ListItem>Breckenridge</asp:ListItem> 
<asp:ListItem>Arapahoe Basin</asp:ListItem> 
<asp:ListItem>Copper Mountain</asp:ListItem> 
</asp:DropDownList>
<br /><br />
<asp:Button ID="Button1" runat="server" Text="Show best lift" OnClick="ResortDropDownList_Click" />
<br /><br />
<asp:Label ID="BestLiftLabel" runat="server" Text="Best lift:"></asp:Label>
<asp:Label ID="BestLiftValueLabel" runat="server"></asp:Label>

Open the sandbox compatible Visual Web Part’s .cs file and add an event handler for the dropdown list.

protected void ResortDropDownList_Click(object sender, EventArgs e)
{    
    switch (ResortDropDownList.SelectedValue)    
    {        
        case "Breckenridge":            
           BestLiftValueLabel.Text = "Falcon Chair";            
           break;
        case "Arapahoe Basin":            
           BestLiftValueLabel.Text = "Palavicini";            
           break;        
        case "Copper Mountain":
            BestLiftValueLabel.Text = "Storm King";
            break;
    }
}

In the Solution Explorer, right click the project node and select Deploy.  Notice the WSP is deployed to the Solutions Gallery where sandboxed solutions are deployed.  (http://<server>/_catalogs/solutions/Forms/AllItems.aspx)

Solutions Gallery

Add the sandbox compatible Visual Web Part to a SharePoint page and test it out.

Best Lift Web Part

Return to Visual Studio and try to add some code (to the sandbox compatible Visual Web Part) which is not permitted in the sandbox.  In this example I added a SharePoint DateTimeControl control.

<SharePoint:DateTimeControl ID="DateTimeControl1" runat="server" />  

 

Try to deploy the solution again and notice the error in the Error List which indicates the SharePoint DateTimeControl control is not permitted in the sandbox.

Sandbox Error

As you can see, you can find out before runtime if the code you are trying to run in the sandbox is permitted.  This feature, coupled with the ability to use the visual designer to create sandbox compatible Visual Web Parts certainly saves development time.  Thanks Mike and team!

author: Todd Baginski | posted @ Monday, June 21, 2010 12:00 AM | Feedback (2)