Posts Tagged ‘SharePoint’

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

If you haven’t followed the trend today, you’ve most certainly missed out. The Office 2013 and SharePoint 2013 preview versions were released to the wild today. Steve Ballmer did a LIVE pressrelease where he revealed that the new versions of Office and SharePoint are now officially available for public beta consumption. This is pretty amazing news, so I’ll just leave you with the following information and links and you can be certain that I’ll update this blog regularly with content of SharePoint 2013 awesomeness from this day forth :-)

office15

Download the SharePoint 2013 preview binaries

You can find some of the relevant downloads right here:

SharePoint 2013 binaries

SharePoint Designer 2013 binaries

 

SharePoint Server 2013 SDKs

 

Microsoft Office Web Apps Server 2013

 

Duet Enterprise for SharePoint 2013 and SAP 2.0

 

Enjoy – and see you on the other side :-)

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

A while back an announcement was made that TFSPreview.com had been made available for general testing. Various bloggers at Microsoft put an invitation token in their MSDN blogs so everyone can have a go at it.

In this article series we’ll take a very quick look at what the hosted TFS solution by Microsoft looks like.

Articles currently in the series:


Getting your first scheduled build up and running

In order to get a scheduled build that talks to your TFSPreview repository, you’ll need to follow these steps and make sure the prerequisites are fulfilled.

Prerequisites

Note: If you don’t have SharePoint 2010 installed, the installer have an option for installing SharePoint Foundation 2010 for you. In my case however, I’ve got SharePoint Server 2010 Enterprise running already.

Installing the package

First of all, launch the ISO file that was extracted from the downloaded package and you should see this screen:
image

We want to install Team Foundation Server before we proceed, so choose the first option under the Install headline, which will bring you to this dialog:
image

You’ll need to accept the EULA and if you’re awesome you’ll keep the second checkbox checked so Microsoft can review any issues that may be encountered during the process so they can have a look at them pre-RTM. Click Continue and then click Install Now in the dialog that follows:
ScreenShot1300

You may or may not need to reboot the computer while it’s performing the installation, depending on whether you’ve had some of the prerequisite artifacts installed prior to the installation or not.

Now just sit tight for a while as the installer takes care of the installation for you. Grab a newspaper, get a coffee, check some important stuff on Twitter or simply multitask with other things while you wait.

When it’s done, you’ll have a few options of what type of installation you want to do:
image

Please note: At this point you have several options for how to proceed with your installation. You can now choose one of the following installation options:

  • Configure Team Foundation Application Server
  • Configure Team Foundation Server Proxy
  • Configure Team Foundation Build Service
  • Configure Extensions for SharePoint Products

In my case I’ll be choosing the "Configure Team Foundation Build Service" since I only need the actual Build Agents and Build Service – the TFSpreview.com is hosting the actual TFS server.

Next step will present you with a dialog like the following, where you’ll have to choose what default team project collection to utilize for the build server. Since we don’t have TFS installed the box is currently empty, but fear not for your TFS server is hosted in the cloud (tfspreview.com, remember?) so we’ll just have to go and add that connection as well.

Click the "Browse…" button to open the dialog for choosing your TFS connection
image

If you haven’t already connected to a TFS server, this dropdown will be empty. Click "Servers…":
image

Click the "Add…" button:
image

Finally enter the URL to your TFS collection and click "OK":
image

You will see a dialog that enables you to log in to the services (use the Login details you signed up with for tfspreview.com):
image

When the sign-in is completed you’ll see that you now have a list of TFS collections. Choose your DefaultCollection (or otherwise) and click "Connect":
image

It should hopefully say something like this, telling you there’s no build servers unless you’ve already configured it previously:
image

In the next dialog I’ll choose "Use the default setting" for my setup:
image

In the next dialog you’ll have to choose credentials for your build rig. I’m using a dedicated domain account called SHAREPOINTSPBuild:
image

Make sure you validate the configuration and then press "Next"
image

If awesomeness is found on your machine, it should look something like this:
image

Click the "Configure" button and let the installer have its way for a while. Hopefully all these fancy green icons will show you that things went smoothly:
image

With that done, in the next dialog you’ll see a nice "Success" message and you’re ready to start creating and work with your build agents:
image

Validate the Build Server

On your Start Menu, you should find the following new shortcut:
image

Clicking the "Team Foundation Server Administration Console" should bring you forth the following dialog where you can validate that your machine is properly up and running with a build server and agents. Click the "Build Configuration" option in the menu to the left and make sure your build agents are running under the controller:
image

Summary

If you’ve followed along with the steps in this post you’ll see how easy it is to get up and running with creating a build server (controllers+agents) for your TFS. In this case, I chose to do a connection to the TFSpreview-hosted TFS account.

In my next post in this series I’ll talk about how you can create a new build from Visual Studio 2010 from your dev-machine and have it automatically build on this build server. Gotta love automation!

Enjoy.

Sweden SharePoint User Group – Malmö / Stockholm

January 30th, 2012 by Tobias Zimmergren

Introduction

The Sweden SharePoint User Group (SSUG) is a non-profit organization where we continuously  provide meet-ups and presentations about SharePoint in Sweden.
There’s no doubt that everyone’s been very busy the last year and things aren’t about to change now. As we head deeper into 2012 I’m sure we’ll have plenty of awesome SharePoint-related meetings and conferences to attend!

The group started in Stockholm several years ago when Me (Tobias Zimmergren), Göran Husman, Wictor Wilén and Daniel Bugday decided to join our forces and provide a common ground for people in Sweden that are interested in SharePoint.

We’ve conducted several meetings in Stockholm, a few meetings in Gothenburg and unfortunately only one meeting in Malmö. Things are about to change!

With our new establishment of TOZIT AB in the region, I’ve decided to shorten down the long trips I’ve previously had and focus my attention to this region (Öresundsregionen – Helsingborg/Lund/Malmoe/Copenhagen etc.) – this means more time for the SSUG (Sweden SharePoint User Group) in Malmö as well.

Upcoming Event – Malmö

During late February or early March we’ll have our first meeting since 2008, when myself and Carsten Keutmann did presentations on SharePoint Online and WSPBuilder.

Agenda: TBD

Location: Malmö

Date & Time: During March

Upcoming Event – Stockholm

Update: The details for the SSUG Event in Stockholm have been published, and you can sign up and read more here: http://ssug.eventbrite.com/

Agenda:

  • Mattias Karlsson, Microsoft: Talks about Microsoft PFE
    How does the Microsoft support work? What does a PFE do?
  • Wictor Wilén, Connecta: Talks about the MCM and MCA Programs
    What are the Microsoft Certified Masters and Certified Architect programs? 
  • Session 3: To Be Decided
    TBD

Location: Microsoft HQ, Akalla (Stockholm)

Date & Time: March 15th, 18:00 CET

Sign up here: http://ssug.eventbrite.com/

Sponsors and Speakers

The routines for our meetings is that we’ve got a sponsor to host the meeting (provide meeting rooms, projectors and food/beverages) and we’ve had one or more speakers during an evening.

We’re currently looking for:

  • Meeting Sponsors: Where you provide your offices or conference rooms for our meetings
  • Speakers: Where you talk about whatever interests you in SharePoint. Here’s some of the popular focus areas we’ve had speakers talk about before:
    • Focus: Development
    • Focus: Architecture
    • Focus: End User Adoption
    • Focus: No-Code Solutions
    • Focus: Marketing
    • Focus: Show Cases / How-We-Did-It

See you soon at a local SSUG meeting!

Enjoy.

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

A while back an announcement was made that TFSPreview.com had been made available for general testing. Various bloggers at Microsoft put an invitation token in their MSDN blogs so everyone can have a go at it.

In this article series we’ll take a very quick look at what the hosted TFS solution by Microsoft looks like.

Articles currently in the series:


Connect Visual Studio 2010 to your new hosted team project

In order to be able to connect to the hosted TFSPreview team project, you’ll need to comply with the prerequisites I’m listing here.

Prerequisites

Hook up Visual Studio to your new repository/project

Alright, if you’ve downloaded and installed KB2581206 (which means you’re spinning VS2010 SP1 already) you are read to connect. The procedure to connect to the hosted TFS service is basically the same as if you were to connect to any other TFS repository, which is easy and awesome.

In Visual Studio 2010 SP1, simply make these smooth ninja moves and you’re done:
image

Make sure to fetch the URL of your account (As seen in your dashboard, like depicted below):
image

Enter this URL in the Visual Studio 2010 dialogs and we’re ready to kick off:
image

It’ll ask you for your credentials which you need to use to verify your account details:
image

You should now be authenticated and your repository should be available:
image

You’ll go ahead as you normally do and choose the projects that interests you and then you’re basically done:
image

Your Team Explorer should contain your TFS project and you should be able to work with it as you normally would from Visual Studio 2010:
image

This means you’ve got all of your standard tasks and operations available straight from VS 2010 (So you don’t have to go to the website to make changes …):
image

Summary

Easy enough. As soon as you’ve downloaded the required tooling to get connected, you can hook up your new cloud-hosted team project in Visual Studio 2010 without any problems. Give it a spin, it flows quite nicely!

Enjoy.

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

SharePoint 2010 developing for performance article series:
In this series of articles I will briefly introduce you to some key concepts when it comes to developing for performance in our SharePoint 2010 applications.

Related articles in this article series

Part 8 (this article):
As most of you know, in any ASP.NET project (SharePoint included) there’s something you know as ViewState.  With the ViewState we can persist state of our properties in the page controls and objects across postbacks that happen in our solutions. If we are not careful and plan the usage of ViewState properly, we can end up with a performance hit that will slightly decrease the performance in the page rendering process.

In this article we will take a look at what impact the ViewState can have if we “forget about it”, and of course how we can prevent our pages from being unnecessarily big in page size.

ViewState in our SharePoint projects

If you’ve been developing SharePoint projects of any type, you’ve most certainly been doing some kind of asp.net UI development as well. (Application Pages, Web Parts, User Controls and so on) that are inheriting the asp.net capabilities and hence the ViewState.

What you should know as an ASP.NET developer: Be sure to know when you should, or shouldn’t use the ViewState. You can disable the usage of ViewState for certain components, or the entire page.

Performance considerations

With an increased ViewState you get an increased Page Size which in turn obviously means that the page will take a bit longer to render.

We’ll take a quick look at how the performance can differ when we’re using ViewState and when we’re disabling the ViewState in a SharePoint project.

Taking a look: ViewState

In order for us to really understand what impact the ViewState can have on the page rendering process, we’ll dig into the details of the what the ViewState looks like. To do this we can check out the source of the rendered page, and of course we’ll rely on our faithful squire; Fiddler2.

Before we’ll start digging with the Fiddler2-application, we can simply check the Page Source of any given page being rendered and we’ll most likely find a heap of ViewState madness going on in there.

In my sample application that only consist of a simple GridView control and a few rows of data – the ViewState is turned into this:

 <input type= "hidden "

 

  name= "__VIEWSTATE "

 

  id= "__VIEWSTATE "

 

  value= "/wEPDwULLTE5NjIxMzI1MDIPZBYCZg9kFgICAQ9kFgQCAQ9kFgICDw9kFgJmD2QWAgIBD

 

  w8WAh4HVmlzaWJsZWdkZAIDD2QWBgIRD2QWBGYPZBYEAgEPZBYCZg9kFgQCAg9kFgYCAQ8WAh8Aa

 

  GQCAw8WCB4TQ2xpZW50T25DbGlja1NjcmlwdAVdamF2YVNjcmlwdDpDb3JlSW52b2tlKCdUYWtlT

 

  2ZmbGluZVRvQ2xpZW50UmVhbCcsMSwgMSwgJ2h0dHA6XHUwMDJmXHUwMDJmc3BmJywgLTEsIC0xL

 

  CAnJywgJycpHhhDbGllbnRPbkNsaWNrTmF2aWdhdGVVcmxkHihDbGllbnRPbkNsaWNrU2NyaXB0Q

 

  29udGFpbmluZ1ByZWZpeGVkVXJsZB4MSGlkZGVuU2NyaXB0BSFUYWtlT2ZmbGluZURpc2FibGVkK

 

  DEsID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QBQ5TYW1wbGUgSXRlbSAxOWRkAgIPDxYCH

 

  xAFIlppbW1lcmdyZW4ncyBQZXJmb3JtYW5jZSBTYW1wbGUgMTlkZAIVD2QWBmYPDxYCHxAFAjIwZ

 

  GQCAQ8PFgIfEAUOU2FtcGxlIEl0ZW0gMjBkZAICDw8WAh8QBSJaaW1tZXJncmVuJ3MgUGVyZm9yb

 

  WFuY2UgU2FtcGxlIDIwZGQCFg9kFgZmDw8WAh8QBQIyMWRkAgEPDxYCHxAFDlNhbXBsZSBJdGVtI

 

  DIxZGQCAg8PFgIfEAUiWmltbWVyZ3JlbidzIFBlcmZvcm1hbmNlIFNhbXBsZSAyMWRkAhcPZBYGZ

 

  g8PFgIfEAUCMjJkZAIBDw8WAh8QBQ5TYW1wbGUgSXRlbSAyMmRkAgIPDxYCHxAFIlppbW1lcmdyZ

 

  W4ncyBQZXJmb3JtYW5jZSBTYW1wbGUgMjJkZAIYD2QWBmYPDxYCHxAFAjIzZGQCAQ8PFgIfEAUOU

 

  2FtcGxlIEl0ZW0gMjNkZAICDw8WAh8QBSJaaW1tZXJncmVuJ3MgUGVyZm9ybWFuY2UgU2FtcGxlI

 

  DIzZGQCGQ9kFgZmDw8WAh8QBQIyNGRkAgEPDxYCHxAFDlNhbXBsZSBJdGVtIDI0ZGQCAg8PFgIfE

 

  AUiWmltbWVyZ3JlbidzIFBlcmZvcm1hbmNlIFNhbXBsZSAyNGRkAhoPDxYCHwBoZGQYAgUfY3RsM

 

  DAkUGxhY2VIb2xkZXJNYWluJEdyaWRWaWV3MQ88KwAKAQgCKWQFR2N0bDAwJFBsYWNlSG9sZGVyV

 

  G9wTmF2QmFyJFBsYWNlSG9sZGVySG9yaXpvbnRhbE5hdiRUb3BOYXZpZ2F0aW9uTWVudVY0Dw9kB

 

  QRIb21lZGnihW5zRhNmmnQef2E5KXJlKgIU" />

 

If you compare the aforementioned ViewState with the very same page but with the ViewState disabled, it would look like this:

 <input type="hidden"

 

  name="__VIEWSTATE"

 

  id="__VIEWSTATE"

 

  value="/wEPDwULLTE5NjIxMzI1MDJkGAIFH2N0bDAwJFBsYWNlSG9sZGVy

 

  TWFpbiRHcmlkVmlldzEPPCsACgEIAilkBUdjdGwwMCRQbGFjZUhvbGRlclR

 

  vcE5hdkJhciRQbGFjZUhvbGRlckhvcml6b250YWxOYXYkVG9wTmF2aWdhdG

 

  lvbk1lbnVWNA8PZAUESG9tZWTEsK7AlAZmIZYt/bke1dmkbPKxhg=="/>

 

What impact can these few lines of markup have on the page rendering process anyway, you say? Well, in order to find out – let’s summon our good friend Fiddler2 and do a quick comparison.

ViewState Enabled

ViewState Disabled

Body size (bytes) 14 534 bytes 12 883 bytes
Load time (seconds) 0.3765430 seconds 0.2031263 seconds

A visual comparison of the same page with versus without ViewState enabled:

Body Size comparison (bytes)

Load Time comparison (seconds)

image image

So what can I do to tune and tweak the ViewState?

There’s generally two good initial tips for tuning the ViewState.

  • Disable ViewState for the entire page
  • Disable ViewState for selected components

The first option is good if you don’t need to use ViewState in any of the components on your page. Then you can simply disable ViewState by setting the ViewStateEnabled property to false:

  <%@ Page Language="C#"

 

     AutoEventWireup="true"

 

     CodeBehind="ViewStateSample.aspx.cs"

 

     Inherits="Zimmergren.Samples.ViewState.ViewStateSample"

 

     DynamicMasterPageFile="~masterurl/default.master"

 

     EnableViewState="false"  %>

 

The second option is good if you need the ViewState for certain components, but you want to disable it for others. You can disable the ViewState for specific components;

     <asp:GridView ID="GridView1"

 

         runat="server"

 

         AutoGenerateColumns="False"

 

         AllowSorting="true"

 

         AllowPaging="true"

 

         PageSize="25"

 

 EnableViewState="false"

 

         />

 

Additional Tip: Take a look at HTTP compression

In addition to being aware of the ViewState in any asp.net project, you should take a look at HTTP Compression that you can enable in IIS.

Read more on HTTP Compression

Summary

Alright – the summer is officially over (at least of you take a look at the recent weather) and I’m back in the saddle. In this article I’ve been talking a bit about how the ViewState can impact your performance in any asp.net project (hence SharePoint project). The reason for talking about it is that I’ve seen quite the amount of projects as of late that doesn’t think about the impact a huge ViewState can have on the time it takes to download and render a page on the client.

An important consideration that I’ve learned throughout all our projects to create Internet-facing sites based on SharePoint (or plain old ASP.NET) is to measure the performance in different scenarios, including some stress testing and load tests. In most of these projects we’ve seen an increased performance if we take time to select what components or pages should disable ViewState. It might be worth considering.

Note that this is a minimal sample with minimal impact. Consider when you’ve got a huge page with 10+ Web Parts and all using the ViewState, even if they don’t really need to – can you imagine the page load times increasing? The answer is probably yes :-)

Enjoy.

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

After many-a-requests I’ve decided to do an article on how you can work with an Azure-hosted SQL Server and consume that data in SharePoint 2010.

Related articles for working with external data in SharePoint 2010:

A few introductory details about this article…

In this article I will discuss and guide you through how you can utilize the power, scalability, flexibility and awesomeness that comes with the cloud. By following this article you will get an introduction to how you can work with SharePoint together with Windows Azure to store business data.

This article will be an introduction to developing SharePoint solutions to work with Windows Azure, and in later articles I will discuss other approaches where Windows Azure may be a good solution to incorporate in the plans for your organization together with Office 365 and SharePoint Online.

Please note that this article is NOT intended to be an introduction to setting up Windows Azure. Its an introduction to setting up the connection from SharePoint to SQL Azure. More in-depth articles are coming up later.

Prerequisites

In order to follow along with this article and repro these steps yourself, you will need to have the following things in place already:

  • A Windows Azure developer account
  • An SQL Azure database and a table in that database
  • Visual Studio 2010
  • SharePoint Designer 2010
  • A few sprinkles of awesomeness in your pocket would be nice, just for fun

Please note that in SQL Azure you’d need to hook up the IP-address of the machine running this code or service in order to enable it for connectivity with the SQL Azure database. You’ll see more about that in your SQL Azure portal.

Connect to SQL Azure using Business Connectivity Services in SharePoint 2010

In this section I will talk about how we can create a connection to our SQL Azure database from SharePoint by utilizing BCS. I will for the ease of demo use SharePoint Designer to set it up – and to prove that it works!

1. Make sure you’ve got existing data in one of your SQL Azure databases

In my setup, I’ve got a database called ZimmergrenDemo and a table called ProductSales. I can access the database either from the Windows Azure Platform portal or directly from the SQL Server Management Studio:

image

image

I’ve got some sample data that I’ve popped into the SQL Azure Database:

image

2. Setting up a Secure Store Service configuration for your SQL Azure connection

In order for the BCS runtime to easily be able to authenticate to the SQL Azure database (which is using different credentials than your Windows Server/Domain), you can create a Secure Store application and use that for authentication.

1. Create a new Secure Store Application

Go to Central Admin > Mange Service Applications > Secure Store Service > New

Create a new Secure Store application, looking something like this:
image

2. Configure the Secure Store application fields

I add one field for User Name and one for Password, something like this:

image

3. Add the administrator account(s) needed

image

Voila! Your Secure Store application is setup, now let’s move on to working with the data in our SQL Azure database.

3. Working with the data though Business Connectivity Services

Now that the SQL Azure database is available and your Secure Store application is configured, it’s time to get the BCS up and running with SharePoint Designer.

The first and foremost option to get up and running quickly is of course to hook up an External List and be able to see your data straight through the standard SharePoint UI.

For a detailed step-by-step instruction for the whole routine to set up a new BCS connection, please refer to my previous articles.

1. Configure the BCS connection using SharePoint Designer

Launch SharePoint Designer and create a new External Content Type and select the SQL option for the data source. Enter the information to your SQL Azure database and the application ID for your Secure Store application.

Connecting to your SQL Azure database through BCS via SPD:
image

Since you need to enter the credentials for your impersonated custom identity (the SQL Azure database credentials) – you’ll get this dialog:

Enter the credentials to your SQL Azure database:
image

Once that is taken care of, you will be able to follow the normal routines for configuring your BCS connection.

My SQL Azure database, right inside of SPD:
image

2. Create an external list and navigate to it in your browser

In whatever way you prefer, create an external list for this External Content Type and navigate to it. You will probably see a link saying “Click here to authenticate“.

Click the link, and you will be provided with this interface:

image

I probably don’t have to explain that this is where you’ll enter your SQL Azure User Name and Password to make sure your BCS connection authenticates to your SQL Azure database properly.

Okay, when the external list is created and you’ve configured the authentication – you’ll see your data flying in directly from SQL Azure into your SharePoint external list for consumption!

image

And as always, the coolest thing here is that it’s read and write enabled straight away – you can work with the items in the list much like normal items in any list. Sweet.

Consume the data programmatically from SQL Azure instead

If you don’t want to go with the BCS-approach and just do code directly instead then all you need to do is make sure that you wear the developer-hat and start hacking away a few simple lines of code.

Working with SQL Azure is like working with any other data source, so there’s really no hunky dory magic going on behind the scenes – it’s all just pretty basic.

Here’s a sample Web Part I created to collect the data from SQL Azure and display in SharePoint 2010.

image

Here’s most of what the code could look like:

     public partial class VisualProductSalesUserControl : UserControl
     {
         private const string connectionString = "Server=tcp:YOURSERVER.database.windows.net;Database=ZimmergrenDemo;User ID=Username@YOURSERVER;Password=myAwesomePassword++;Trusted_Connection=False;Encrypt=True;" ;
         private string selectCommand = "select * from ZimmergrenDemo.dbo.ProductSales;" ;
         private DataTable productSalesData = new DataTable ("ProductSales" );
         protected void FetchAndFill(string connectionString, string selectCommand)
         {
             using (var connection = new SqlConnection (connectionString))
             {
                 var adaptor = new SqlDataAdapter
                 {
                     SelectCommand = new SqlCommand (selectCommand, connection),
                 };

 

                 adaptor.Fill(productSalesData);
                 salesGrid.DataSource = productSalesData;
                 salesGrid.DataBind();
             }
         }
         protected void Button1_Click(object sender, System.EventArgs e)
         {
             FetchAndFill(connectionString, selectCommand);
         }
     }

 

Summary

In this article I talked briefly about how you can connect to your SQL Azure database using BCS and then utilize that information from SharePoint – or create a custom solution to access the data.

The reason for this article is to show you that working with Azure isn’t a big and scary task to take upon you – it’s actually all very straight forward!

Enjoy.

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

SharePoint 2010 developing for performance article series:
In this series of articles I will briefly introduce you to some key concepts when it comes to developing for performance in our SharePoint 2010 applications.

Related articles in this article series

Part 1 – SP 2010: Developing for performance Part 1 – Developer Dashboard
Part 2 – SP 2010: Developing for performance Part 2 – SPMonitoredScope
Part 3 – SP 2010: Developing for performance Part 3 – Caching in SharePoint 2010
Part 4 – SP 2010: Developing for performance Part 4 – Logging
Part 5 – SP 2010: Developing for performance Part 5 – Disposal patterns and tools
Part 6 – SP 2010: Developing for performance Part 6 – CSS Sprites
Part 7 – SP 2010: Developing for performance Part 7 – Crunching those scripts
Part 8 – SP 2010: Developing for performance Part 8 – Control that ViewState

Part 7 (this article):
This article is a bit shorter than the others and will only cover the concept of crunching your script files in your projects. The reasoning behind a crunched file is to save on transfer-bytes between the client and server.

JavaScript crunching

The technique called script crunching (or JavaScript crunching) is often referred to a way of eliminating useless characters from the script files to allow them to load faster. This means that by eliminating unnecessary whitespaces, line breaks and putting semicolons in the right places you can achieve a file size that is smaller than the original.

The reasoning behind crunching the script files are much that you can save on the client/server transfer and therefore also minimize the HTTP requests – which in turn is one step in the right direction for minimizing the page load time and render time.

Short in short; Do consider the technique if you’ve got large scripts that are taking a bit too long to load.

SharePoint 2010 are using crunched scripts

In SharePoint 2010 we already have a few examples of where JavaScript crunching is working in action. One example is the SP.js file which is essentially a crunched JavaScript library in SharePoint 2010. You do however also have the ability to use the SP.debug.js which contains the same content, but without being crunched.

When you look at those two files in an editor, you’ll quickly see the difference between them:

SP.js – 381 KB – Crunched JavaScript file in SharePoint 2010
image

SP.debug.js – 561 KB – The same file, but without the crunch
image

You can see that the mail difference between these two files is the file size. This means that if you’ve using the crunched version of the JavaScript file, your application will load slightly faster.

How to: Crunch your script files

There’s tons of tools on the market for crunching your scripts. Here’s a few online tools for crunching those scripts:

(or just search for JavaScript crunch, and you’ll find all the tools you’ll ever need)

What is the difference when using crunched scripts?

As a quick summary I did a test with an application that are loading a somewhat large script file – first without any crunching and then the same application loading the files after they’ve been minimized with a crunch. These are the results in my SharePoint 2010 application.

Without crunching

After crunching

JavaScript file size: 445871 bytes
(435 KB)
JavaScript file size: 331798 bytes
(324 KB)
  Saves around 25.5% in file size

image

Summary

A brief summary of the result is that if you’re crunching your script files, you’ll get a slightly smaller footprint when loading the page and making the HTTP requests. The reason for bringing this to your attention is of course that it’s a technique that’s been around for quite some time, but people tend to miss out on it because they’ve not seen the results of it. So, here you go – a visual chart telling you how it differs to use the exact same script, with and without crunching.

Enjoy.

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

The last week that just passed was filled with quite some cool happenings over at the BPCUK Conference in London. If you’ll follow the #BPCUK tag on Twitter you’ll find all the juicy information that you missed out on – there’s no real need for me to repeat it here :-)

Downloads

As promised, my session deck on Silverlight and SharePoint 2010 can be downloaded here: Download!

SP 2010: Developing for performance Part 6 – CSS Sprites

April 8th, 2011 by Tobias Zimmergren

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

SharePoint 2010 developing for performance article series:
In this series of articles I will briefly introduce you to some key concepts when it comes to developing for performance in our SharePoint 2010 applications.

Related articles in this article series

Part 1 – SP 2010: Developing for performance Part 1 – Developer Dashboard
Part 2 – SP 2010: Developing for performance Part 2 – SPMonitoredScope
Part 3 – SP 2010: Developing for performance Part 3 – Caching in SharePoint 2010
Part 4 – SP 2010: Developing for performance Part 4 – Logging
Part 5 – SP 2010: Developing for performance Part 5 – Disposal patterns and tools
Part 6 – SP 2010: Developing for performance Part 6 – CSS Sprites
Part 7 – SP 2010: Developing for performance Part 7 – Crunching those scripts
Part 8 – SP 2010: Developing for performance Part 8 – Control that ViewState

Part 6 (this article):
In web development today its very important to keep performance in mind – this is especially important in any site that is published externally or for whatever reason will have heavy traffic. In this article I will briefly cover the area of CSS Sprites, how they are implemented in SharePoint 2010 and of course how you can create them yourself.

Introduction to CSS Sprites

What are CSS sprites anyway?

CSS sprites is a technique used to reduce the number of requests for images on a site when visiting it. Normally when you see a web site today there’s plenty of files being requested and loaded upon the request made. With the use of CSS sprites we can reduce the amount of files that we need to request from the server by consolidating many image files into one file and use CSS to display the correct part of that consolidated image when it needs to depict your specific image.

Short in short: Take a bunch of separate images and smack them together to one single file. Voila, you’ll only need to request one file from the server.

SharePoint 2010 and CSS Sprites

So why are we talking about CSS sprites here anyway, isn’t this supposed to be all about SharePoint and awesomeness? But of course, and that’s exactly why we’re talking about it – CSS sprites are a natural part of a normal SharePoint 2010 installation. By default, there’s CSS sprite techniques used to render and display images in (for example) the Ribbon menu.

These are some samples of images used with CSS sprites in SharePoint 2010:

FGIMG.PNG jsgridcluster.png
FGIMG jsgridcluster

As you can see in any of the two images above the many small images/icons have been smashed together into one single image file and then there’s some CSS magic to position it. This is basically what it’s all about.

Why should I bother learning to use CSS sprites?

This would be like asking yourself the question "Why would I develop something that is of great performance" or "Why would I do something awesome". No more rhetorical questions please ;-)

Of course the reasoning behind creating CSS sprites are that you can develop web applications that can reduce the page load and enhance the performance of your sites and make them load quicker and be more responsive.

Creating CSS sprites for my applications? How?

There’s a few ways to create CSS sprites for you own applications.

  • Do it manually.
    • This approach requires a lot from you (the designer) in order to hack it up properly and make sure it’s pixel-correct.
  • Do it using a tool
    • This approach is what I normally use.
    • With any of the tools on the market to create CSS sprites you’re better off than doing it manually – all you have to do is dump you images into an application and it’ll output one single image along with the CSS markup for that. Awesome.

For obvious reasons mentioned above I will not be demonstrating how to do this manually but will rather be using any of the hundreds of tools out there to create the sprites.

In this example I’m going to use my main man Waldek’s tool called SpriteGenerator.

There’s a bunch of other tools available to create and generate these sprites as well of course, bing.com is thy friend.

How to: Generate CSS sprites using a tool

In this section I’ll talk you through our current application and what it looks like, what we want to achieve and finally how to achieve it.

Our current application, a visual sample

This is my current sample application before we start using sprites.

Control Panel Web Part (dummy):
image

This is the Visual Studio project, containing all the images and resources:
image

As you can see there’s quite some images being loaded. The images used in the application (my Web Part) will be fetched using a normal HTTP-request and that’s when one could realize how quickly those small requests can add up to impact performance.

This application uses some generic HTML markup like this:

         <div  class="width300p"> 
             <div  class="leftalign floatleft width30"> 
                 <div  class="height70p"><asp:Image  ID="Image2"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/mail.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image3"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/message.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image4"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/more.png"  /></div> 
             </div> 
             <div  class="centeralign floatleft width30"> 
                 <div  class="height70p"><asp:Image  ID="Image5"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/notebook.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image9"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/search.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image13"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/favorites.png"  /></div> 
             </div> 
             <div  class="width30 floatright"> 
                 <div  class="height70p"><asp:Image  ID="Image6"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/info.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image7"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/logoff.png"  /></div> 
                 <div  class="height70p"><asp:Image  ID="Image8"  runat="server"  ImageUrl="/_layouts/images/TOZIT.CSSSprites/question.png"  /></div> 
             </div> 
         </div>

Now, in order for us to utilize the CSS sprites instead, and not have to make a request for each of the images separately – we’ll use the SpriteGenerator and create us some nice CSS sprite magic.

Using the Sprite Generator to make some magic

Like I said before, we’ll be using Waldek’s SpriteGenerator for this sample.

Just open it, put in the images you’d like for it to make some magic with and then simply hit the magic button.

Tip: Check out how to use the SpriteGenerator here

The result of using the SpriteGenerator can look something like this:
image

This is one consolidated image containing all the graphic from my application. But instead of having about 30 different icons in my project, I now have only one.

The generator will create the CSS needed as well, and it can look something like this:

.sprite { background: url(‘/_layouts/images/TOZIT.CSSSprites/TOZIT_Sprite.png’) no-repeat top left; }
.pc { background-position: -0px 0; width: 47px; height: 64px; }
.question { background-position: -47px 0; width: 53px; height: 64px; }
.info { background-position: -100px 0; width: 54px; height: 64px; }
.mail { background-position: -154px 0; width: 54px; height: 64px; }
.more { background-position: -208px 0; width: 54px; height: 64px; }
.user { background-position: -262px 0; width: 55px; height: 64px; }
.world { background-position: -317px 0; width: 55px; height: 64px;  }
.video { background-position: -372px 0; width: 56px; height: 64px; }
.favorites { background-position: -428px 0; width: 57px; height: 64px; }
.edit { background-position: -485px 0; width: 60px; height: 64px; }
.date { background-position: -545px 0; width: 64px; height: 57px; }
.file { background-position: -609px 0; width: 64px; height: 64px; }
.group { background-position: -673px 0; width: 64px; height: 58px; }
.home { background-position: -737px 0; width: 64px; height: 62px; }
.left_arrow { background-position: -801px 0; width: 64px; height: 59px; }
.logoff { background-position: -865px 0; width: 64px; height: 78px; }
.notebook { background-position: -929px 0; width: 64px; height: 51px; }
.rigth_arrow { background-position: -993px 0; width: 64px; height: 57px; }
.search { background-position: -1057px 0; width: 64px; height: 61px; }
.sound { background-position: -1121px 0; width: 64px; height: 58px; }
.stop { background-position: -1185px 0; width: 64px; height: 59px; }
.vault { background-position: -1249px 0; width: 64px; height: 53px; }
.message { background-position: -1313px 0; width: 66px; height: 64px; }
.image { background-position: -1379px 0; width: 84px; height: 84px; }
.tozitlogo { background-position: -1463px 0; width: 250px; height: 101px; }

Now, what this really means is that you now have the ability to actually use only one single image to portray several.

New Visual Studio structure

Obviously, with the new update and only using one single image – the Visual Studio project might look something like this:

image

New HTML markup

And finally, there needs to be some changes in the HTML markup to reflect the changes with the images. The markup could look something like this:

         <div  class="leftalign floatleft width30"> 
             <div  class="height70p sprite mail">&nbsp;</div> 
             <div  class="height70p sprite message"  >&nbsp;</div> 
             <div  class="height70p sprite more"  >&nbsp;</div> 
         </div>

How does using CSS Sprites affect requests, hence performance?

Dealing with sprites isn’t very hard to get started with as you saw in the previous short samples. But what’s more interesting from a performance perspective is of course how it can affect the performance of the requests being made towards the server.

Let’s do some generic Fiddler-magic to see what the requests look like without using sprites and then what the requests look like with the use of sprites.

Fiddler test 1: NOT using CSS sprites

image

Request Count 17 total requests made to the server!
Bytes Sent 8 137 bytes
Bytes Received 76 164 bytes

Fiddler test 2: Using CSS sprites

image

Request Count 3 total requests made to the server!
Bytes Sent 1 722 bytes
Bytes Received 139 369 bytes

What you can easily conclude from the initial tests is that there’s more requests without the CSS sprites, while the size can be slightly larger for a consolidated image when using the sprites.
It’ll load and render quicker by downloading only the 3 files instead of the 17 files due to the aggregation time it takes to render the content.

Visualize the results, please!

Using CSS sprites
(Time in seconds to load the data)
NOT using CSS sprites
(Time in seconds to load the data)
image image

RESPONSE BYTES
image/png:    120 250
text/html:    16 593
~headers~:    1 748
text/css:    778

RESPONSE BYTES
image/png:    52 417
text/html:    16 709
~headers~:    6 260
text/css:    778

ACTUAL PERFORMANCE
Aggregate Session time:   
00:00:00.531 (0.5 seconds)
Sequence (clock) time:
00:00:00.4281250 (0.4 seconds)

ACTUAL PERFORMANCE
Aggregate Session time:
00:00:01.390 (1.3 seconds)
Sequence (clock) time:
00:00:00.5625000 (0.5 seconds)

I did some tests with two machines, two different projects and a couple of clients to request the pages and the results (on average) was something like this in rendering time. The chart below is a relative visualization of the results per average.

Chart

Summary

The impact of a system with a lot more requests for data than these samples, more users and in generally more traffic would differ a bit more than the charts here. Using sprites in combination with caching the data is a good practice to keep the amount of requests to the server to a minimum.

Even if this minor change don’t have any critical impact on improving the performance it’s important to consider. "All improvements are good improvements".

Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren

Introduction

It probably doesn’t surprise anyone that the BPC conference in London is one of the main events to look forward to in the realm of SharePoint conferences.

I will of course be attending this conference and I’ll be delivering an introductory  session about Silverlight and SharePoint.

My session: Developing with Silverlight + SharePoint 2010 = Awesome

I’ll be talking about how you can utilize Silverlight in SharePoint 2010 to create some cool RIA applications hosted inside (or outside!) of SharePoint.

In this session you’ll get acquainted with what Silverlight is and how it plays along with SharePoint 2010 in various ways.

We’ll of course be looking at how to create our very own Silverlight Web Parts and applications and host them inside of SharePoint 2010.

The preliminary agenda of the session looks something like this;

  • Silverlight 101
  • Integrate with SharePoint 2010
  • Preferred deployment methods and developer guidance
  • Developer patterns
  • OOB Experience (Out of Browser) – Bring your Silverlight app to your desktop
  • And much more

Last years conference (Evolutions conference)

Just like you already know there was a volcano that found it suitable to erupt just in time for the conference last year that put a cane in the wheels for a lot of the attendees and speakers.

My flights were cancelled in last minute so I had to find another way of making my way to the conference last year. One day before the conference I basically gave up hope and I just posted a tweet on Twitter saying "Hey, I need to go from Sweden to England, any takers?".

A few minutes later a good friend of mine calls me up saying "Hey, I’m going to The Netherlands to pick up my girl since the flights are cancelled and boats and trains are full. I’m leaving in a few hours by car toward NL. Care to join?"

Alright, why not I thought… We drove from Sweden through Denmark, Germany and finally reached Rotterdam in Holland after a long journey. This is where he picked up his girl and were bound to head back to Sweden again.

I’m dropped off there, in the middle of nowhere, without any means of getting back to Sweden or getting on to England. All the boats and trains were full, remember? 
This is where I’m using Twitter again and post a tweet asking if anyone is in Rotterdam and will be driving to England in the near future.

Marianne tweets me back saying "Hey, we’ve got a spare seat in the car, we’ll pick you up tomorrow at 08.00 outside your chosen hotel". Sweet! Now we’re talking.

We drove from Holland through Belgium and France to finally take the Eurotunnel and reach England.

Even though that trip was a real blast and can’t really be depicted in words here, I really hope that the flights are leaving as scheduled this time!

Steve explaining the long journey

Summary

So if you’re attending BPC UK this year and care to join us in our adventures in the SharePoint jungle and the pubs – ping me.

This year I’m counting on the flights and I’m hoping to see as many of you as possible for the conference in London next week.

Until then, be awesome.