Monday, December 31, 2007

Security for Web part connections

It is possible to enable security for web parts from the Central Administration. Enabling or disabling this option will establish the webpart connections in the Page.

Navigate to Central Administration-> Application Management - > Application Security


In the "Security for WebPart Pages" page, Select the web application for which the web part connections need to be disabled,



In the Web part connections sections enable the Prevents users from creating connections between webparts, and helps to improve security and performance.


The webparts connections will not be enabled and the users are prevented from creating webpart connections

Before Enabling:



After Enabling:

Monday, December 24, 2007

Disable Right Click in SharePoint Site

You can prevent users from right-clicking in your sharepoint site. Add a content editor web part and add the following piece of code in the source editor of the content editor web part.




Save the content editor web part. Users are now prevented from the right click option on the page. Happy coding

Creating custom links in the Quick Launch bar

Quick launch bar is the left panel in the SharePoint site that is used for navigation.

1. Navigate to the Site Actions Menu to the Site Settings Page of your site


2. In the Quick Launch page the Add Heading is used to create a new Group in the Quick launch, and new link can also be added in the already existing Headings


3. To create a new Heading, click on the New Heading link which will open the following page,


4. To create a new link, click on the New Link and add the new link with the group header for the link


5. The new link is now created under the Heading Yahoo and the link is now visible in the Quick Launch bar


WhitePaper for SQL Storage and Performance for SharePoint

Microsoft has released a whitepaper that provides recommendations on the database architecture, Network Topology recommendations and the Physical storage recommendations. The whitepaper also provides information on monitoring, maintaining and troubleshooting storage issues. The whitepaper can be downloaded from, http://technet2.microsoft.com/Office/f/?en-us/library/ca472046-7d4a-4f17-92b1-c88a743a5e3c1033.mspx

Saturday, December 22, 2007

Workflow Permissions in SharePoint 2007

Workflows are designed under the security concept that they run as System Account in the Windows SharePoint Services and the App Pool Identity on the server computer and domain. In Windows SharePoint Services the workflows always have administrator privileges, whatever privileges the App Pool has. This makes it possible for the workflows to perform actions routing of documents etc.

Workflows running under administrator privileges enable users who are not administrators to elevate their own privileges by running a workflow to perform actions they ordinarily could not. This setting cannot be changed, it is up to the workflow to detect user actions and decide whether or not to continue or rollback changes or impersonate a user to mimic their permissions.

When associating a workflow, the Start Options, allow users to manually start a workflow with edit permissions which is enabled by default. This means that any authenticated Windows SharePoint Services user with edit permissions on the list can start an instance of this workflow association. If the administrator checks the “Require Manage List Permissions to start the workflow”, then only the list administrators can start an instance of the workflow’s association. Administrators can use restrict users enabling user defined workflows associated to the site. This option is available in the Central Administration.





The enable user-defined workflows for this site option in the workflow settings of the application management of Central Administration, will enable custom workflows to be associated with the particular site. This option is enabled by default. Settings for alert notifications can also be changed for alert notifications need to be sent or not for internal users who do not have site access when they are assigned a workflow task, and also for sending alert notifications to external users to participate in workflow by sending them a copy of the document.

Friday, December 21, 2007

Programmatically retrieving Site Usage in SharePoint 2007

Site Usage reports can be retrieved programmatically by using the GetUsageData method from the SPWeb class. This method would return a Data Table that contains information about the usage of the site based on the specified type of report, interval, number of columns and the last day to display. The GetUsageData method can be obtained from the Microsoft.SharePoint Namespace.

Alternatively site usage reports can also be viewed from the site settings menu. However this option is available when it is enabled from the Central Administration's Usage Analysis Logging. The log file is located by default in the 12 hive of SharePoint in the LOGS folder. However there is an option available in central administration to change the logging path.

Thursday, December 20, 2007

Summary Link Web Part

Summary Link Webpart can be used to provide a summary of links from both inside of your SharePoint site and also from outside for SharePoint. The Summary link webpart provides an easy way to build a page of links to various resources. This webpart is an out of the box webpart available in SharePoint. The Summary link webpart can be added to any page that supports the following welcome page layouts,
  1. Advanced Search
  2. Intranet Home
  3. News home
  4. People search results page
  5. Search page
  6. Search results
  7. Site directory home
  8. Welcome page with Table of contents

The summary link webpart can be configured to contain styles, headers, and groups. The links provided in this webpart can also contain images.

Wednesday, December 19, 2007

Activating Intellisense for CAML

XML files developed for Windows SharePoint Services 3.0 can be modified or new xml files for WSS 3.0 can be created using CAML. However by default Microsoft Visual Studio does not provide intellisense for CAML development. It is possible to enable intellisense for CAML based xml files in the following manner,
Create a new text file and name it as CAML.xml and add the following code,

targetNamespace="http://schemas.microsoft.com/sharepoint/"/>


Save the CAML.xml in the following path, C:\Program Files\Microsoft Visual Studio 8\XML\Schemas\CAML.xml

Shutdown and restart Visual Studio, intellisense will begin to work that rely on the following schema of CAML,
http://schemas.microsoft.com/sharepoint/namespace

Intellisense can be enabled for any schema in a similar method, however visual studio will only detect the schema, only when after restarting the same as visual studio examines the xml files in the directory at startup to determine which xml schema to be loaded to drive intellisense.

CAML

CAML is Collaborative Application Markup Language (CAML) is an XML based language that is used in Windows SharePoint Services to define the fields and views used by sites and lists. CAML is also used to define tables in the Windows SharePoint Services database during site provisioning.

Site Customization using CAML
CAML can be used in various ways to customize a SharePoint site, including the following,

  • In script or code that implements members of the Windows SharePoint Services object model, where CAML strings are passed through method parameters, assigned to properties, or returned by methods and properties
  • In SOAP messaging that passes CAML strings to a Windows SharePoint Services Web service to interact remotely with a deployment
  • In front-end site definitions used to instantiate SharePoint sites
  • In Features to add specific functionality within a particular scope

Monday, December 17, 2007

SharePoint Errors

The following are some articles that are useful in identifying SharePoint errors. SharePoint errors are logged in the event viewer and in SharePoint logs located in the 12 hive in the following path. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS

Error codes logged in the Event viewer
http://www.brienposey.com/kb/troubleshooting_sharepoint_errors.asp

Single SignOn Error codes and what they mean
http://blogs.msdn.com/harsh/archive/2007/03/21/single-signon-error-codes-and-what-they-mean.aspx

WebPart error
“A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe”
http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=189

To turn on Custom Error
http://www.andrewconnell.com/blog/archive/2007/02/01/5935.aspx

Thursday, December 13, 2007

Feature Element in Feature.xml

The Feature Element tag in a feature.xml file defines the feature and specifies the location of assemblies, files, dependencies or properties that support the Feature.

Some of the attributes that can be defined in a Feature Element are,
  1. ActivateOnDefault - This attribute when set to true states that the feature is activated by default during installation of the feature. This attribute is provided at the web application scope and does not work at the site collection or web level.
  2. AlwaysForceInstall - This attribute can be set to true if the feature is installed by force, even if the feature is installed already.
  3. AutoActivateInCentralAdmin - This attribute can be set to true if the feature is activated by default in Administrative Web site, site collection or central administration. This attribute does not apply to Farm Scoped features.

Though these attributes are optional they prove very useful at times.

Form Services Limitations

Infopath 2007 has many new features and controls, however the following are the controls and features of Infopath 2007 that are not supported by Infopath Form services.

The controls that are not supported in Infopath Form Services are,
1.ActiveX control
2.Bulleted list control
3.Choice group
4.Choice section
5.Combo box
6.Horizontal repeating table
7.Horizontal region
8.Ink picture control
9.Master/detail control
10.Multiple-selection list box
11.Numbered list control
12.Picture control
13.Plain list control
14.Repeating choice group
15.Repeating recursive section
16.Scrolling region
17.Vertical label

The business logic features that are not supported in Infopath Form Services are,
1.Userroles

The security related features that are not supported in Form services are,
1.Restricted Security Level
2.Form Design Protection
3.Information Rights Management

The data connection features that are not supported in Infopath Form Servcies,
1.Query data from a Microsoft Office Access database
2.Submit data to a Microsoft Office Access Database
3.Submit data to a Microsoft SQL server database

The filling out forms features that are not supported by Infopath Form services,
1.Merge data from multiple forms
2.Export data to Microsoft Office Excel
3.Export data to Web
4.Ink support
5.Offline support
6.Spell checking
7.AutoSave, AutoRecover, or crash detection features
8.Custom task panes
9.Add-in menus

The view related features that are not supported in Infopath Form Services
1.Word print views
2.Multiple print views at once
3.Print Page breaks, headers or footers

The programming features that are not supported in Infopath Form services
1.Scripting
2.COM add-ins

Tuesday, December 11, 2007

WSS 3.0 and MOSS SP1 has been released

You can get the latest of the SharePoint 2007 service packs from the following links,
Windows SharePoint Services 3.0 Service Pack 1 (SP1)
2007 Microsoft Office Servers Service Pack 1 (SP1)

Microsoft's SharePoint Capacity Planning Tool Beta

Microsoft has released the beta version of the SharePoint Capacity Tool. This tool as the name says it all is will guide you on the kind of infrastructure needs and farm topology design based on the number of users, network bandwidth, hardware availability etc.

You can get the tool from this Link

Monday, December 10, 2007

Change the Welcome Page in Publishing template of SharePoint

To change the welcome page of a SharePoint site based on the publishing template to a custom aspx page,
  1. Place your aspx page in the _layouts folder of the 12 hive of SharePoint
  2. Navigate to the Site Settings page from the Site Actions menu of your site
  3. Under the Look and feel section, click on the welcome page option
  4. Type the url of the custom welcome page in the _layouts folder
  5. Click ok

w3wp associated with your SharePoint application

To find which w3wp is associated with your SharePoint application,
  1. Open command prompt
  2. Navigate to C:\Windows\System32
  3. Type CScript iisapp.vbs

The iisapp.vbs is a vbscript file that lists all the worker processes along with their process ids running in the IIS

Reschedule or Change the interval of a SharePoint custom Timer Job

To reschedule or change the interval of a SharePoint custom Timer Job
  1. Change the schedule interval in the custom code using the SPDailySchedule class of the SharePoint object model

  2. Build and deploy in the GAC.

  3. IISRESET

  4. Go to the command prompt and navigate to the 12 hive of SharePoint

  5. Uninstall the existing Timer feature, for example, stsadm.exe –o uninstallfeature –filename yourfeaturename\feature.xml

  6. Install the new Timer feature, for example, stsadm.exe –o installfeature –filename yourfeaturename\feature.xml

  7. Go to the windows services and restart the Windows SharePoint Services Timer

Unknown error during check in or check out

If you get an unknown error when you try to check in or check out your document in Microsoft Office SharePoint Server 2007, then it is possible that you have an incorrect installation of MOSS in your server.

Try the following KB article, for a detailed study for the symptoms and the workaround.
http://kbalertz.com/556031/Unknown-Error-SharePoint.aspx

Wednesday, November 28, 2007

Performance Testing tools for SharePoint 2007

There is no performance tool specific to SharePoint. When I was assigned the task of optimising a SharePoint site the search for a tool gave me very limited options.

Codeplex's Data Population tool could be useful for load testing. Other than that would go for the following tools which would be able to give some good information on the performance factor. Apart from these I would suggest the SharePoint applications to implement the best practices available in using the SharePoint object model.

Tools for Performance testing a SharePoint site,

1. Microsoft VSTS Testing
a. Availability
This project type is packaged with Visual Studio 2005.
b. Description
i.The software includes a suite of test tools that are integrated with Microsoft Visual Studio 2005.
ii.It lets you create, manage, edit and run tests, and also obtain and store results.
iii.Several test types, including unit, web, load and manual tests, in addition to the measurement of code coverage are integrated.
iv.VSTS Testing simulates users and acts as a load testing tool.
c. Benefits
i. Total Requests
ii. Request/Sec
iii. Failed Requests
iv. Cached Requests
v. Average
vi. Provides the number of Errors
vii. Provides a graph on the Test

2. Fiddler
a. Availability
i. Third Party Freeware tool
b. Description
i. Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data.
c. Benefits
i. Provides Request count
ii. Bytes Sent
iii. Bytes Received
iv. Total Sequence Time
v. Round Trip cost
vi. Break up of the Response Bytes for Images, headers, html, CSS, Jpeg, Plaintext, and Flash.
vii. Provides a chart on the break of response bytes for images, headers, html, CSS, Jpeg, plaintext and Flash.
3. HTTPWatch
a. Availability
i. Basic edition is a free download
ii. Profession edition is licensed version.
1. Professional edition has some enhanced features such as the export to xml, display detailed HTTP information including headers, cookies, streams etc.
b. Description
HttpWatch integrates with Internet Explorer and records detailed information about HTTP as you access a web site or application. If you access a site that uses secure HTTPS connections, HttpWatch automatically displays the decrypted form of the network traffic.
c. Features
i. Captures Headers and Cookies
ii. URLs and Method (e.g., GET, POST, etc)
iii. Elapsed Time
iv. Network Round Trips
v. Downloaded Data
vi. Uploaded Data
vii. HTTP Compression Savings
viii. DNS Lookups

Tuesday, October 23, 2007

GUID of ContentTypes using SPContentType

The following code snippet can be used to retrieve the GUID of the Content Types used in SharePoint.

using (SPSite site = new SPSite("http://servername:9000/Pages/Default.aspx"))
{
using (SPWeb web = site.OpenWeb())
{
SPContentTypeCollection contenttypecollection = web.ContentTypes;
foreach (Microsoft.SharePoint.SPContentType contenttype in contenttypecollection)
{
lbContentTypes.Items.Add("Name - " + contenttype.Name + " GUID - " + contenttype.Id);
}
}
}

Friday, September 21, 2007

IsCurrentUserMemberOfGroup

The IsCurrentUserMemberOfGroup method of the SPWeb class can be used to check if the currently logged in user is a member of a group or not. This method will return a boolean value that will specify whether the current user is a member of the specified group.

The parameter for this method would be the groupId which is a 32 bit integer. If the return value is true then means that the user is a member of the specified group and otherwise false.

SPWeb.IsCurrentUserMemberOfGroup(groupId)

Thursday, August 23, 2007

Programmatically retrieve Blocked File types in SharePoint

File types blocked by SharePoint can be retrieved using the SharePoint Object Model. The SPWebApplication.BlockedFileExtensions property will provide the file extensions that are blocked in SharePoint. This property returns a collection object that represents files that cannot be uploaded or downloaded in SharePoint.

SPWebApplication webapp = SPWebApplication.Lookup(new Uri("http://servername:9000"));
foreach (string str in webapp.BlockedFileExtensions)
{
lbBlockedFileTypes.Items.Add(str);
}

Monday, July 2, 2007

Associate a workflow



Set the tag in the metadata section to true in the workflow.xml file to associate a workflow for a document library with the Document Content Type. This will enable the workflow to be associated by default with all the document libraries of document content type.

Tuesday, June 26, 2007

Cannot connect to content database error in SharePoint with Event ID 5617

If you encounter the traditional SharePoint cannot connect to database error, with the following from the EventViewer then, run the command "stsadm.exe -o upgrade -inplace -url http://{central%20administration%20site}/"
This process may take a minutes to hours to finish up but it clears up the bug.

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Topology
Event ID: 5617
Date: 10/11/2007
Time: 12:14:02 PM
User: N/A
Computer: ESSSHAREPOINT20
Description:The schema version (3.0.149.0) of the database on Servername\OfficeServers is not consistent with the expected database schema version (3.0.151.0) on . Connections to this database from this server have been blocked to avoid data loss. Upgrade the web front end or the content database to ensure that these versions match.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Sunday, June 17, 2007

SharePoint Solution Package deployment error

If you encounter an error of type "Error 102 An object of the type Microsoft.SharePoint.Administration.SPSolution named "SolutionPackageName" already exists under the parent Microsoft.SharePoint.Administration.SPFarm named "SharePointContentDBName". Rename your object or delete the existing object", then even though if you remove the references of the solution in the sites, SharePoint will not allow to redeploy the solution.

The issue can be solved by, browse to the Central Administration -> Operations -> Solution Management and then delete the wsp file that caused the error and then redeploy the file again.

Office 2003 Add-in Web Parts and Components in WSS 3.0

Microsoft Office Web Parts and Components is a collection of Web Parts, Web Part Page solutions, templates, and data retrieval services that work closely with Microsoft Office 2003 and Microsoft Windows SharePoint Services 2.0. These added features are particularly useful for large organizations that have deployed Microsoft Office throughout their organization and that want to take advantage of the enhanced functionality and efficiencies these Web Parts and components provide for their sites.

These webparts can be used in Windows SharePoint Services 3.0. To install these webparts in WSS 3.0 use the "stsadm.exe -o addwpack" command. The web part can be added to your page from the Web part gallery.

It works fine for me. However if you encounter any error try the workaround specified in the following knowledge base article.
http://support.microsoft.com/kb/929320

Saturday, June 16, 2007

SAP's Webdav connector for WSS

WebDav is Web-based Distributed Authoring and Versioning Protocol. The Webdav connector is used to integrate SAP with Windows SharePoint Services.

The Connector is a plugin that is available for download in the following Microsoft site

http://www.microsoft.com/isv/sap/technology/interop/ep.aspx

The connector provides full access to all Windows SharePoint Services based document libraries. Provides full support for custom properties / meta data. Full support for Windows SharePoint Services' Versioning capablities.

SPIisWebsiteUnprovisioningJobDefinition Error while deleting a Web Application in SharePoint

The following error might occur while deleting a web application in SharePoint "An object of the type Microsoft.SharePoint.Administration.SPIisWebsiteUnprovisioningJobDefinition named "Unprovionsing PWN" already exists under the parent Microsoft.SharePoint.Administration.SpWebservice named "". Rename your object or delete the existing object."

A possible solution for this issue can be,

  • Navigate to the Central Administration Site,
  • Go to the Operations tab
  • click on the Timer Job Definition
  • Delete the Unprovisionning web application from the list
  • Go ahead and Delete the Web application.

Friday, June 15, 2007

Integrate SharePoint 2007 and CRM 3.0 (SQL 2005)

The CRM List Web Part can be downloaded from the below link.
http://www.microsoft.com/downloads/details.aspx?FamilyId=BC9B3526-DECF-4057-A530-91840C0D5401&displaylang=en

Though this webpart was developed for the earlier version of SharePoint, it can be used in MOSS 2007 with the workaround specified in the following link,

http://blogs.msdn.com/mscrmfreak/archive/2007/01/16/microsoft-crm-and-moss-2007-workaround.aspx

To start using the web part follow the following steps after the workaround process,
  • Goto Command Prompt and navigate to the path where the Stsadm.exe is present ( c:\Program Files\Common Files\Microsoft Shared\Web Server Extension\12\Bin )
  • Type -> stsadm.exe -o deletewppack -name MicrosoftCRMListWebPart.cab
  • This will unistall the currently installed web part cab package.
  • To install it in the GAC Type the following command;stsadm.exe -o addwppack -globalinstall -force -filename "MicrosoftCRMListWebPart.cab"

The web Part should be installed in the GAC, Now try to put the web part in the page there wont be any issues.

Sunday, June 3, 2007

Shrink SharePoint content database size

To free up the SharePoint Content Database space, you can use the following SQL command

dbcc shrinkdatabase(WSSContentDatabaseName)

Auditing in SharePoint

You can enable auditing at the site collection level, to enable monitoring the following in SharePoint 2007

  • Documents opened

  • Documents downloaded

  • List items viewed

  • List item properties viewed

  • Items edited

  • Document checkout

  • Document check in

  • Items Edited

  • Items Deleted

  • Items restored

  • Content types Editing

  • Searching site content

  • Editing user accounts

  • Editing permissions

Monday, May 21, 2007

Creating a custom activity in workflow and using it in SharePoint Designer to implement Item level permissions in SharePoint 2007

Item level permissions can be implemented in sharepoint 2007 using either the SharePoint object model or the by using the out of the box features.

Programmatically providing item level security in sharepoint 2007 can be implemeted either by using event handlers which would mean that the event handlers need to be modified for every list or document library that it is associated with. Alternatively this can be overcome by creating activities in Windows workflow library and plugging it in SharePoint designer and thereby the workflow activity can be associated with any list at any time without modifying the dll.

To create such an activity which can be plugged in to SharePoint designer and which is used to provide item level security follow the walkthrough posted by me in the following link,

http://www.codeproject.com/KB/sharepoint/CustomActivity.aspx

Friday, April 6, 2007

Implementing ASP.Net AJAX in MOSS 2007

Description

To implement ASP.Net AJAX in MOSS 2007 environment.

Technology Used

Microsoft ASP. NET AJAX, MOSS 2007

Steps involved in implementing AJAX in MOSS 2007

1. Install ASP.NET AJAX on servers in your farm

2. Download the full "ASP.NET 2.0 AJAX Extensions 1.0" from
ajax.asp.net.

3. Extend your SharePoint site’s web.config file with Microsoft ASP.NET AJAX 1.0. Modify your SharePoint web.config file with the appropriate settings for the ASP.net Ajax Extensions. Mike Ammerlaan has the details on this.

4. No need to add the ScriptManager into a SharePoint MasterPage

5.Create a SharePoint Web Part with controls that implements AJAX

a. Create a Web Part Project

b. Add references to Microsoft.SharePoint, System.Web dlls.

c. Implement the following code.

This code creates a Calendar, Textbox and a Button control in an UpdatePanel. When the Calendar control is clicked the selected date is populated in the Textbox Control. When the “Clear Text” button control is clicked the text in the Textbox control is cleared.
d. Points to be noted
i. Override the OnInit method.
ii. The EnsureUpdatePanelFixups method is used to register the Script Manger control in the web part.

using System;
using System.Collections.Generic;
using System.Text;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint.Utilities;

namespace CalenderWP
{
public class Calender : System.Web.UI.WebControls.WebParts.WebPart
{
UpdatePanel up;
Calendar calender;
TextBox text;
Button button;
private ScriptManager _AjaxManager;

protected override void RenderContents(HtmlTextWriter writer)
{

up.RenderControl(writer);
writer.Write("
");
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.EnsureUpdatePanelFixups();
}

protected override void CreateChildControls()
{
up = new UpdatePanel();
up.ID = "UpdatePanel1";
up.ChildrenAsTriggers = true;
up.UpdateMode = UpdatePanelUpdateMode.Conditional;
this.Controls.Add(up);

this.calender = new Calendar();
this.calender.ID = "Calender";
this.calender.SelectionChanged += new EventHandler(calender_SelectionChanged);
up.ContentTemplateContainer.Controls.Add(this.calender);

this.text = new TextBox();
this.text.Text = DateTime.Now.ToShortDateString();
up.ContentTemplateContainer.Controls.Add(this.text);

this.button = new Button();
this.button.ID = "button";
this.button.Text = "Clear Text";
this.button.Click += new EventHandler(button_Click);
up.ContentTemplateContainer.Controls.Add(this.button);

}

void calender_SelectionChanged(object sender, EventArgs e)
{

this.text.Text = calender.SelectedDate.ToShortDateString();
}

void button_Click(object sender, EventArgs e)
{
this.text.Text = string.Empty;
}

private void EnsureUpdatePanelFixups()
{

_AjaxManager = ScriptManager.GetCurrent(this.Page);

if (_AjaxManager == null)
{
_AjaxManager = new ScriptManager();
_AjaxManager.EnablePartialRendering = true;

Page.ClientScript.RegisterStartupScript(typeof(Calender), this.ID, "_spOriginalFormAction = document.forms[0].action;", true);

if (this.Page.Form != null)
{
string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
{
this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
}

this.Page.Form.Controls.AddAt(0, _AjaxManager);
}
}
}



#region Properties
///


/// Exposes the Page's script manager. The value is not set until after OnInit
///

[WebPartStorage(Storage.None)]
public ScriptManager AjaxManager
{
get { return _AjaxManager; }
set { _AjaxManager = value; }
}
#endregion
}

Monday, December 31, 2007

Security for Web part connections

It is possible to enable security for web parts from the Central Administration. Enabling or disabling this option will establish the webpart connections in the Page.

Navigate to Central Administration-> Application Management - > Application Security


In the "Security for WebPart Pages" page, Select the web application for which the web part connections need to be disabled,



In the Web part connections sections enable the Prevents users from creating connections between webparts, and helps to improve security and performance.


The webparts connections will not be enabled and the users are prevented from creating webpart connections

Before Enabling:



After Enabling:

Monday, December 24, 2007

Disable Right Click in SharePoint Site

You can prevent users from right-clicking in your sharepoint site. Add a content editor web part and add the following piece of code in the source editor of the content editor web part.




Save the content editor web part. Users are now prevented from the right click option on the page. Happy coding

Creating custom links in the Quick Launch bar

Quick launch bar is the left panel in the SharePoint site that is used for navigation.

1. Navigate to the Site Actions Menu to the Site Settings Page of your site


2. In the Quick Launch page the Add Heading is used to create a new Group in the Quick launch, and new link can also be added in the already existing Headings


3. To create a new Heading, click on the New Heading link which will open the following page,


4. To create a new link, click on the New Link and add the new link with the group header for the link


5. The new link is now created under the Heading Yahoo and the link is now visible in the Quick Launch bar


WhitePaper for SQL Storage and Performance for SharePoint

Microsoft has released a whitepaper that provides recommendations on the database architecture, Network Topology recommendations and the Physical storage recommendations. The whitepaper also provides information on monitoring, maintaining and troubleshooting storage issues. The whitepaper can be downloaded from, http://technet2.microsoft.com/Office/f/?en-us/library/ca472046-7d4a-4f17-92b1-c88a743a5e3c1033.mspx

Saturday, December 22, 2007

Workflow Permissions in SharePoint 2007

Workflows are designed under the security concept that they run as System Account in the Windows SharePoint Services and the App Pool Identity on the server computer and domain. In Windows SharePoint Services the workflows always have administrator privileges, whatever privileges the App Pool has. This makes it possible for the workflows to perform actions routing of documents etc.

Workflows running under administrator privileges enable users who are not administrators to elevate their own privileges by running a workflow to perform actions they ordinarily could not. This setting cannot be changed, it is up to the workflow to detect user actions and decide whether or not to continue or rollback changes or impersonate a user to mimic their permissions.

When associating a workflow, the Start Options, allow users to manually start a workflow with edit permissions which is enabled by default. This means that any authenticated Windows SharePoint Services user with edit permissions on the list can start an instance of this workflow association. If the administrator checks the “Require Manage List Permissions to start the workflow”, then only the list administrators can start an instance of the workflow’s association. Administrators can use restrict users enabling user defined workflows associated to the site. This option is available in the Central Administration.





The enable user-defined workflows for this site option in the workflow settings of the application management of Central Administration, will enable custom workflows to be associated with the particular site. This option is enabled by default. Settings for alert notifications can also be changed for alert notifications need to be sent or not for internal users who do not have site access when they are assigned a workflow task, and also for sending alert notifications to external users to participate in workflow by sending them a copy of the document.

Friday, December 21, 2007

Programmatically retrieving Site Usage in SharePoint 2007

Site Usage reports can be retrieved programmatically by using the GetUsageData method from the SPWeb class. This method would return a Data Table that contains information about the usage of the site based on the specified type of report, interval, number of columns and the last day to display. The GetUsageData method can be obtained from the Microsoft.SharePoint Namespace.

Alternatively site usage reports can also be viewed from the site settings menu. However this option is available when it is enabled from the Central Administration's Usage Analysis Logging. The log file is located by default in the 12 hive of SharePoint in the LOGS folder. However there is an option available in central administration to change the logging path.

Thursday, December 20, 2007

Summary Link Web Part

Summary Link Webpart can be used to provide a summary of links from both inside of your SharePoint site and also from outside for SharePoint. The Summary link webpart provides an easy way to build a page of links to various resources. This webpart is an out of the box webpart available in SharePoint. The Summary link webpart can be added to any page that supports the following welcome page layouts,
  1. Advanced Search
  2. Intranet Home
  3. News home
  4. People search results page
  5. Search page
  6. Search results
  7. Site directory home
  8. Welcome page with Table of contents

The summary link webpart can be configured to contain styles, headers, and groups. The links provided in this webpart can also contain images.

Wednesday, December 19, 2007

Activating Intellisense for CAML

XML files developed for Windows SharePoint Services 3.0 can be modified or new xml files for WSS 3.0 can be created using CAML. However by default Microsoft Visual Studio does not provide intellisense for CAML development. It is possible to enable intellisense for CAML based xml files in the following manner,
Create a new text file and name it as CAML.xml and add the following code,

targetNamespace="http://schemas.microsoft.com/sharepoint/"/>


Save the CAML.xml in the following path, C:\Program Files\Microsoft Visual Studio 8\XML\Schemas\CAML.xml

Shutdown and restart Visual Studio, intellisense will begin to work that rely on the following schema of CAML,
http://schemas.microsoft.com/sharepoint/namespace

Intellisense can be enabled for any schema in a similar method, however visual studio will only detect the schema, only when after restarting the same as visual studio examines the xml files in the directory at startup to determine which xml schema to be loaded to drive intellisense.

CAML

CAML is Collaborative Application Markup Language (CAML) is an XML based language that is used in Windows SharePoint Services to define the fields and views used by sites and lists. CAML is also used to define tables in the Windows SharePoint Services database during site provisioning.

Site Customization using CAML
CAML can be used in various ways to customize a SharePoint site, including the following,

  • In script or code that implements members of the Windows SharePoint Services object model, where CAML strings are passed through method parameters, assigned to properties, or returned by methods and properties
  • In SOAP messaging that passes CAML strings to a Windows SharePoint Services Web service to interact remotely with a deployment
  • In front-end site definitions used to instantiate SharePoint sites
  • In Features to add specific functionality within a particular scope

Monday, December 17, 2007

SharePoint Errors

The following are some articles that are useful in identifying SharePoint errors. SharePoint errors are logged in the event viewer and in SharePoint logs located in the 12 hive in the following path. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS

Error codes logged in the Event viewer
http://www.brienposey.com/kb/troubleshooting_sharepoint_errors.asp

Single SignOn Error codes and what they mean
http://blogs.msdn.com/harsh/archive/2007/03/21/single-signon-error-codes-and-what-they-mean.aspx

WebPart error
“A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe”
http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=189

To turn on Custom Error
http://www.andrewconnell.com/blog/archive/2007/02/01/5935.aspx

Thursday, December 13, 2007

Feature Element in Feature.xml

The Feature Element tag in a feature.xml file defines the feature and specifies the location of assemblies, files, dependencies or properties that support the Feature.

Some of the attributes that can be defined in a Feature Element are,
  1. ActivateOnDefault - This attribute when set to true states that the feature is activated by default during installation of the feature. This attribute is provided at the web application scope and does not work at the site collection or web level.
  2. AlwaysForceInstall - This attribute can be set to true if the feature is installed by force, even if the feature is installed already.
  3. AutoActivateInCentralAdmin - This attribute can be set to true if the feature is activated by default in Administrative Web site, site collection or central administration. This attribute does not apply to Farm Scoped features.

Though these attributes are optional they prove very useful at times.

Form Services Limitations

Infopath 2007 has many new features and controls, however the following are the controls and features of Infopath 2007 that are not supported by Infopath Form services.

The controls that are not supported in Infopath Form Services are,
1.ActiveX control
2.Bulleted list control
3.Choice group
4.Choice section
5.Combo box
6.Horizontal repeating table
7.Horizontal region
8.Ink picture control
9.Master/detail control
10.Multiple-selection list box
11.Numbered list control
12.Picture control
13.Plain list control
14.Repeating choice group
15.Repeating recursive section
16.Scrolling region
17.Vertical label

The business logic features that are not supported in Infopath Form Services are,
1.Userroles

The security related features that are not supported in Form services are,
1.Restricted Security Level
2.Form Design Protection
3.Information Rights Management

The data connection features that are not supported in Infopath Form Servcies,
1.Query data from a Microsoft Office Access database
2.Submit data to a Microsoft Office Access Database
3.Submit data to a Microsoft SQL server database

The filling out forms features that are not supported by Infopath Form services,
1.Merge data from multiple forms
2.Export data to Microsoft Office Excel
3.Export data to Web
4.Ink support
5.Offline support
6.Spell checking
7.AutoSave, AutoRecover, or crash detection features
8.Custom task panes
9.Add-in menus

The view related features that are not supported in Infopath Form Services
1.Word print views
2.Multiple print views at once
3.Print Page breaks, headers or footers

The programming features that are not supported in Infopath Form services
1.Scripting
2.COM add-ins

Tuesday, December 11, 2007

WSS 3.0 and MOSS SP1 has been released

You can get the latest of the SharePoint 2007 service packs from the following links,
Windows SharePoint Services 3.0 Service Pack 1 (SP1)
2007 Microsoft Office Servers Service Pack 1 (SP1)

Microsoft's SharePoint Capacity Planning Tool Beta

Microsoft has released the beta version of the SharePoint Capacity Tool. This tool as the name says it all is will guide you on the kind of infrastructure needs and farm topology design based on the number of users, network bandwidth, hardware availability etc.

You can get the tool from this Link

Monday, December 10, 2007

Change the Welcome Page in Publishing template of SharePoint

To change the welcome page of a SharePoint site based on the publishing template to a custom aspx page,
  1. Place your aspx page in the _layouts folder of the 12 hive of SharePoint
  2. Navigate to the Site Settings page from the Site Actions menu of your site
  3. Under the Look and feel section, click on the welcome page option
  4. Type the url of the custom welcome page in the _layouts folder
  5. Click ok

w3wp associated with your SharePoint application

To find which w3wp is associated with your SharePoint application,
  1. Open command prompt
  2. Navigate to C:\Windows\System32
  3. Type CScript iisapp.vbs

The iisapp.vbs is a vbscript file that lists all the worker processes along with their process ids running in the IIS

Reschedule or Change the interval of a SharePoint custom Timer Job

To reschedule or change the interval of a SharePoint custom Timer Job
  1. Change the schedule interval in the custom code using the SPDailySchedule class of the SharePoint object model

  2. Build and deploy in the GAC.

  3. IISRESET

  4. Go to the command prompt and navigate to the 12 hive of SharePoint

  5. Uninstall the existing Timer feature, for example, stsadm.exe –o uninstallfeature –filename yourfeaturename\feature.xml

  6. Install the new Timer feature, for example, stsadm.exe –o installfeature –filename yourfeaturename\feature.xml

  7. Go to the windows services and restart the Windows SharePoint Services Timer

Unknown error during check in or check out

If you get an unknown error when you try to check in or check out your document in Microsoft Office SharePoint Server 2007, then it is possible that you have an incorrect installation of MOSS in your server.

Try the following KB article, for a detailed study for the symptoms and the workaround.
http://kbalertz.com/556031/Unknown-Error-SharePoint.aspx

Wednesday, November 28, 2007

Performance Testing tools for SharePoint 2007

There is no performance tool specific to SharePoint. When I was assigned the task of optimising a SharePoint site the search for a tool gave me very limited options.

Codeplex's Data Population tool could be useful for load testing. Other than that would go for the following tools which would be able to give some good information on the performance factor. Apart from these I would suggest the SharePoint applications to implement the best practices available in using the SharePoint object model.

Tools for Performance testing a SharePoint site,

1. Microsoft VSTS Testing
a. Availability
This project type is packaged with Visual Studio 2005.
b. Description
i.The software includes a suite of test tools that are integrated with Microsoft Visual Studio 2005.
ii.It lets you create, manage, edit and run tests, and also obtain and store results.
iii.Several test types, including unit, web, load and manual tests, in addition to the measurement of code coverage are integrated.
iv.VSTS Testing simulates users and acts as a load testing tool.
c. Benefits
i. Total Requests
ii. Request/Sec
iii. Failed Requests
iv. Cached Requests
v. Average
vi. Provides the number of Errors
vii. Provides a graph on the Test

2. Fiddler
a. Availability
i. Third Party Freeware tool
b. Description
i. Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data.
c. Benefits
i. Provides Request count
ii. Bytes Sent
iii. Bytes Received
iv. Total Sequence Time
v. Round Trip cost
vi. Break up of the Response Bytes for Images, headers, html, CSS, Jpeg, Plaintext, and Flash.
vii. Provides a chart on the break of response bytes for images, headers, html, CSS, Jpeg, plaintext and Flash.
3. HTTPWatch
a. Availability
i. Basic edition is a free download
ii. Profession edition is licensed version.
1. Professional edition has some enhanced features such as the export to xml, display detailed HTTP information including headers, cookies, streams etc.
b. Description
HttpWatch integrates with Internet Explorer and records detailed information about HTTP as you access a web site or application. If you access a site that uses secure HTTPS connections, HttpWatch automatically displays the decrypted form of the network traffic.
c. Features
i. Captures Headers and Cookies
ii. URLs and Method (e.g., GET, POST, etc)
iii. Elapsed Time
iv. Network Round Trips
v. Downloaded Data
vi. Uploaded Data
vii. HTTP Compression Savings
viii. DNS Lookups

Tuesday, October 23, 2007

GUID of ContentTypes using SPContentType

The following code snippet can be used to retrieve the GUID of the Content Types used in SharePoint.

using (SPSite site = new SPSite("http://servername:9000/Pages/Default.aspx"))
{
using (SPWeb web = site.OpenWeb())
{
SPContentTypeCollection contenttypecollection = web.ContentTypes;
foreach (Microsoft.SharePoint.SPContentType contenttype in contenttypecollection)
{
lbContentTypes.Items.Add("Name - " + contenttype.Name + " GUID - " + contenttype.Id);
}
}
}

Friday, September 21, 2007

IsCurrentUserMemberOfGroup

The IsCurrentUserMemberOfGroup method of the SPWeb class can be used to check if the currently logged in user is a member of a group or not. This method will return a boolean value that will specify whether the current user is a member of the specified group.

The parameter for this method would be the groupId which is a 32 bit integer. If the return value is true then means that the user is a member of the specified group and otherwise false.

SPWeb.IsCurrentUserMemberOfGroup(groupId)

Thursday, August 23, 2007

Programmatically retrieve Blocked File types in SharePoint

File types blocked by SharePoint can be retrieved using the SharePoint Object Model. The SPWebApplication.BlockedFileExtensions property will provide the file extensions that are blocked in SharePoint. This property returns a collection object that represents files that cannot be uploaded or downloaded in SharePoint.

SPWebApplication webapp = SPWebApplication.Lookup(new Uri("http://servername:9000"));
foreach (string str in webapp.BlockedFileExtensions)
{
lbBlockedFileTypes.Items.Add(str);
}

Monday, July 2, 2007

Associate a workflow



Set the tag in the metadata section to true in the workflow.xml file to associate a workflow for a document library with the Document Content Type. This will enable the workflow to be associated by default with all the document libraries of document content type.

Tuesday, June 26, 2007

Cannot connect to content database error in SharePoint with Event ID 5617

If you encounter the traditional SharePoint cannot connect to database error, with the following from the EventViewer then, run the command "stsadm.exe -o upgrade -inplace -url http://{central%20administration%20site}/"
This process may take a minutes to hours to finish up but it clears up the bug.

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Topology
Event ID: 5617
Date: 10/11/2007
Time: 12:14:02 PM
User: N/A
Computer: ESSSHAREPOINT20
Description:The schema version (3.0.149.0) of the database on Servername\OfficeServers is not consistent with the expected database schema version (3.0.151.0) on . Connections to this database from this server have been blocked to avoid data loss. Upgrade the web front end or the content database to ensure that these versions match.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Sunday, June 17, 2007

SharePoint Solution Package deployment error

If you encounter an error of type "Error 102 An object of the type Microsoft.SharePoint.Administration.SPSolution named "SolutionPackageName" already exists under the parent Microsoft.SharePoint.Administration.SPFarm named "SharePointContentDBName". Rename your object or delete the existing object", then even though if you remove the references of the solution in the sites, SharePoint will not allow to redeploy the solution.

The issue can be solved by, browse to the Central Administration -> Operations -> Solution Management and then delete the wsp file that caused the error and then redeploy the file again.

Office 2003 Add-in Web Parts and Components in WSS 3.0

Microsoft Office Web Parts and Components is a collection of Web Parts, Web Part Page solutions, templates, and data retrieval services that work closely with Microsoft Office 2003 and Microsoft Windows SharePoint Services 2.0. These added features are particularly useful for large organizations that have deployed Microsoft Office throughout their organization and that want to take advantage of the enhanced functionality and efficiencies these Web Parts and components provide for their sites.

These webparts can be used in Windows SharePoint Services 3.0. To install these webparts in WSS 3.0 use the "stsadm.exe -o addwpack" command. The web part can be added to your page from the Web part gallery.

It works fine for me. However if you encounter any error try the workaround specified in the following knowledge base article.
http://support.microsoft.com/kb/929320

Saturday, June 16, 2007

SAP's Webdav connector for WSS

WebDav is Web-based Distributed Authoring and Versioning Protocol. The Webdav connector is used to integrate SAP with Windows SharePoint Services.

The Connector is a plugin that is available for download in the following Microsoft site

http://www.microsoft.com/isv/sap/technology/interop/ep.aspx

The connector provides full access to all Windows SharePoint Services based document libraries. Provides full support for custom properties / meta data. Full support for Windows SharePoint Services' Versioning capablities.

SPIisWebsiteUnprovisioningJobDefinition Error while deleting a Web Application in SharePoint

The following error might occur while deleting a web application in SharePoint "An object of the type Microsoft.SharePoint.Administration.SPIisWebsiteUnprovisioningJobDefinition named "Unprovionsing PWN" already exists under the parent Microsoft.SharePoint.Administration.SpWebservice named "". Rename your object or delete the existing object."

A possible solution for this issue can be,

  • Navigate to the Central Administration Site,
  • Go to the Operations tab
  • click on the Timer Job Definition
  • Delete the Unprovisionning web application from the list
  • Go ahead and Delete the Web application.

Friday, June 15, 2007

Integrate SharePoint 2007 and CRM 3.0 (SQL 2005)

The CRM List Web Part can be downloaded from the below link.
http://www.microsoft.com/downloads/details.aspx?FamilyId=BC9B3526-DECF-4057-A530-91840C0D5401&displaylang=en

Though this webpart was developed for the earlier version of SharePoint, it can be used in MOSS 2007 with the workaround specified in the following link,

http://blogs.msdn.com/mscrmfreak/archive/2007/01/16/microsoft-crm-and-moss-2007-workaround.aspx

To start using the web part follow the following steps after the workaround process,
  • Goto Command Prompt and navigate to the path where the Stsadm.exe is present ( c:\Program Files\Common Files\Microsoft Shared\Web Server Extension\12\Bin )
  • Type -> stsadm.exe -o deletewppack -name MicrosoftCRMListWebPart.cab
  • This will unistall the currently installed web part cab package.
  • To install it in the GAC Type the following command;stsadm.exe -o addwppack -globalinstall -force -filename "MicrosoftCRMListWebPart.cab"

The web Part should be installed in the GAC, Now try to put the web part in the page there wont be any issues.

Sunday, June 3, 2007

Shrink SharePoint content database size

To free up the SharePoint Content Database space, you can use the following SQL command

dbcc shrinkdatabase(WSSContentDatabaseName)

Auditing in SharePoint

You can enable auditing at the site collection level, to enable monitoring the following in SharePoint 2007

  • Documents opened

  • Documents downloaded

  • List items viewed

  • List item properties viewed

  • Items edited

  • Document checkout

  • Document check in

  • Items Edited

  • Items Deleted

  • Items restored

  • Content types Editing

  • Searching site content

  • Editing user accounts

  • Editing permissions

Monday, May 21, 2007

Creating a custom activity in workflow and using it in SharePoint Designer to implement Item level permissions in SharePoint 2007

Item level permissions can be implemented in sharepoint 2007 using either the SharePoint object model or the by using the out of the box features.

Programmatically providing item level security in sharepoint 2007 can be implemeted either by using event handlers which would mean that the event handlers need to be modified for every list or document library that it is associated with. Alternatively this can be overcome by creating activities in Windows workflow library and plugging it in SharePoint designer and thereby the workflow activity can be associated with any list at any time without modifying the dll.

To create such an activity which can be plugged in to SharePoint designer and which is used to provide item level security follow the walkthrough posted by me in the following link,

http://www.codeproject.com/KB/sharepoint/CustomActivity.aspx

Friday, April 6, 2007

Implementing ASP.Net AJAX in MOSS 2007

Description

To implement ASP.Net AJAX in MOSS 2007 environment.

Technology Used

Microsoft ASP. NET AJAX, MOSS 2007

Steps involved in implementing AJAX in MOSS 2007

1. Install ASP.NET AJAX on servers in your farm

2. Download the full "ASP.NET 2.0 AJAX Extensions 1.0" from
ajax.asp.net.

3. Extend your SharePoint site’s web.config file with Microsoft ASP.NET AJAX 1.0. Modify your SharePoint web.config file with the appropriate settings for the ASP.net Ajax Extensions. Mike Ammerlaan has the details on this.

4. No need to add the ScriptManager into a SharePoint MasterPage

5.Create a SharePoint Web Part with controls that implements AJAX

a. Create a Web Part Project

b. Add references to Microsoft.SharePoint, System.Web dlls.

c. Implement the following code.

This code creates a Calendar, Textbox and a Button control in an UpdatePanel. When the Calendar control is clicked the selected date is populated in the Textbox Control. When the “Clear Text” button control is clicked the text in the Textbox control is cleared.
d. Points to be noted
i. Override the OnInit method.
ii. The EnsureUpdatePanelFixups method is used to register the Script Manger control in the web part.

using System;
using System.Collections.Generic;
using System.Text;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint.Utilities;

namespace CalenderWP
{
public class Calender : System.Web.UI.WebControls.WebParts.WebPart
{
UpdatePanel up;
Calendar calender;
TextBox text;
Button button;
private ScriptManager _AjaxManager;

protected override void RenderContents(HtmlTextWriter writer)
{

up.RenderControl(writer);
writer.Write("
");
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.EnsureUpdatePanelFixups();
}

protected override void CreateChildControls()
{
up = new UpdatePanel();
up.ID = "UpdatePanel1";
up.ChildrenAsTriggers = true;
up.UpdateMode = UpdatePanelUpdateMode.Conditional;
this.Controls.Add(up);

this.calender = new Calendar();
this.calender.ID = "Calender";
this.calender.SelectionChanged += new EventHandler(calender_SelectionChanged);
up.ContentTemplateContainer.Controls.Add(this.calender);

this.text = new TextBox();
this.text.Text = DateTime.Now.ToShortDateString();
up.ContentTemplateContainer.Controls.Add(this.text);

this.button = new Button();
this.button.ID = "button";
this.button.Text = "Clear Text";
this.button.Click += new EventHandler(button_Click);
up.ContentTemplateContainer.Controls.Add(this.button);

}

void calender_SelectionChanged(object sender, EventArgs e)
{

this.text.Text = calender.SelectedDate.ToShortDateString();
}

void button_Click(object sender, EventArgs e)
{
this.text.Text = string.Empty;
}

private void EnsureUpdatePanelFixups()
{

_AjaxManager = ScriptManager.GetCurrent(this.Page);

if (_AjaxManager == null)
{
_AjaxManager = new ScriptManager();
_AjaxManager.EnablePartialRendering = true;

Page.ClientScript.RegisterStartupScript(typeof(Calender), this.ID, "_spOriginalFormAction = document.forms[0].action;", true);

if (this.Page.Form != null)
{
string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
{
this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
}

this.Page.Form.Controls.AddAt(0, _AjaxManager);
}
}
}



#region Properties
///


/// Exposes the Page's script manager. The value is not set until after OnInit
///

[WebPartStorage(Storage.None)]
public ScriptManager AjaxManager
{
get { return _AjaxManager; }
set { _AjaxManager = value; }
}
#endregion
}