ASP.NET AJAX RC 1 is here! Download now



Moving on with WebParticles 1


Deploying to the _app_bin folder

This post adds to Tony Rabun's post "WebParticles: Developing and Using Web User Controls WebParts in Microsoft Office SharePoint Server 2007". In the original post, the web part DLLs are deployed in the GAC. During the development period, this could become a bit of a pain as you will be doing numerous compile, deploy then test cycles. Putting the DLLs in the _app_bin folder of the SharePoint web application makes things a bit easier.

  1. Make sure the web part class that load the user control has the GUID attribute and the constructor sets the export mode to all.

Figure 1 - The web part class

 

2.   Add the AllowPartiallyTrustedCallers Attribute to the AssemblyInfo.cs file of the web part project and all other DLL projects it is referencing.

Figure 2 - Marking the assembly with AllowPartiallyTrustedCallers attribute

 

3.    Copy all the DLLs from the bin folder of the web part project to the _app_bin folder of your SharePoint web application. Make sure all the DLLs are signed.

Note: You should copy the .pdb files as well to be able to debug the user control code

Figure 3 - Bin folder for web application project referencing DLLs from other projects

Figure 4 - DLLs added to _app_bin folder of the web application

 

4.    Edit the web.config file of the SharePoint web application as follows:

5.    Add the web part assembly to the safe controls section.

Figure 5 - Adding the web part assembly to the safe controls

 

6.    Add the web part assembly to the assemblies section.

Figure 6 - Adding the web part assembly to the assemblies section

 

7.    Now create the .webpart file then add the web part to your SharePoint site web part gallery.

Figure 7 - The .webpart file


Moving on with WebParticles 2


Wiring up event handlers

This post adds to Tony Rabun's post "WebParticles: Developing and Using Web User Controls WebParts in Microsoft Office SharePoint Server 2007". I have noticed that if you leave everything the way ASP.NET does it for you, sometimes the event handlers are not called so below what needs to be done to make sure the event handlers will get called after you deploy the webpart to SharePoint.

  1. In the .ascx file of the user control for the webpart, make sure the AutoEventWireup of the user control is set to "true" (default setting).

  2. Make sure NO event handlers are wired to the controls in the ascx source.

Figure 1 - Remove any event handlers from the ascx source

  1. Override the OnInit event of the user control and wire up all the event handlers there

Figure 2 - Override the OnInit event and wire up the event handlers

Note: When you deploy the user control as a web part in a SharePoint site, the IsPostBack will be always true, so you cannot use the if!(IsPostBack) in the code to check for the first time the page is loaded.


Moving on with WebParticles 3


Localizing the user control web part

This post adds to Tony Rabun's post "WebParticles: Developing and Using Web User Controls WebParts in Microsoft Office SharePoint Server 2007". Here I show how you can use ASP.NET Local Resource files to localize the strings in the user control that will be wrapped as a web part.

  1. Open the user control in Design view.
  2. Select Generate Local Resource from the Tools menu.
  3. This will generate the <UserControlName>.resx resource file. This resource file will hold the default culture strings. You need to copy/paste this file and rename the new copy adding the culture and locale to the resource file name before the .resx. ("ar-jo" in my case). In the new file you can write the localized strings.

Figure 1 - Generating a resource file for the user control

  1. Change the Build Action property of the resx file to Embedded Resource. This compiles the default resource file into the main assembly of the project and the localized resource files into satellite assemblies.

Figure 2 - Changing the Build Action property to Embedded Resource

Figure 3 - Satellite assembly created in ar-jo folder

  1. Add the code to access the compiled resource files to the code behind of the user control.

Figure 4 - Accessing localized strings from compiled resource files within the code

  1. Copy the new assemblies (main and satellite) to the _app_bin folder or the GAC depending on how you are deploying your solution.

Office SharePoint Server 2007 Training


The Microsoft Office SharePoint Server 2007 Training, built on the Microsoft SharePoint Learning Kit, is designed for server administrators to install on an Office SharePoint Server site to help end-users learn about Office SharePoint Server.


Performance and Capacity planning


The Performance and Capacity planning data for Sharepoint 2007 RTM is now available. A nice table relating the requests per second to the number of WFE servers you need can be found at https://technet2.microsoft.com/Office/en-us/library/0a7b2b45-f633-46d2-a4fd-78691d4b8f631033.mspx#Starting

To calculate your requests per second RPS, you can use this folrmula

**

Determining Peak Throughput

Number of users

=

Percentage of active users per day

=

Number of common operations per active user per day

=

Number of complex operations per active user per day

=

Total number of operations per active user per day (common + complex)

=

Number of business hours per day

=

Peak factor (usually ranges between 1-5)

=

**

Using the formula below, calculate the peak throughput (operations per second) required.

1. # of users x & active users per day x # total operations per active user per day x peak factor

= ______

2. Divide the result by 360,000 x # business hours per day = ______ requests per second*

NOTE: The constant 360,000 is derived from the following equation:

100 (percent conversion) x 60 (minutes per hour) x 60 (seconds per minute)


Server Application Unavailable Error with ForeFront Management Console


"Server Application Unavailable" Error when installing ForeFront Management Console to a non default installation folder, i.e. not "c:\program files\...", make sure to give "Network Service" account Modify permission on the new folder you are installing to.


SharePoint 2010 Advanced Training (IT Pro & Dev) released


From the team formerly known as SharePoint Ignite – there's a ton of new public training material on SharePoint 2010 that was released. Although you might consider this to be "SharePoint Ignite RTM", for those of you who've attended or otherwise consumed the SharePoint Ignite training, this has been extensively revised since the Beta 2 version. Great stuff.

 

· Dev: https://msdn.microsoft.com/en-us/sharepoint/ff420377.aspx

· ITPro: https://technet.microsoft.com/en-us/sharepoint/ff420396.aspx