Pages

Showing posts with label AJAX in Webparts. Show all posts
Showing posts with label AJAX in Webparts. Show all posts

Saturday, October 23, 2010

Build AJAX Enabled Web Parts in SharePoint 2007

Hello Friends

There are so many scenarios where entire Sharepoint 2007 application uses OOTB (out of the box) functionality  but we need to develop some custom webparts which uses AJAX Functionality so rather than making changes in web.config and master pages for entire application , we can write the same thing in the webpart itself in its OnInit function.

protected override void OnInit(EventArgs e)
{
if (ScriptManager.GetCurrent(this.Page) == null)
{
scriptManager = new ScriptManager();
scriptManager.ID = “myScriptManager”;
scriptManager.EnablePartialRendering = true;
this.Page.Form.Controls.Add(scriptManager);
}
base.OnInit(e);
}
Thanks
Disha Shah