Pages

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

2 comments:

  1. Hi Disha,

    Need your help on the infopath requirement.

    Intailly, the checkbox control was disable on the form template. i want to enable the checkbox after submit the form.
    it means once open existing form template the checkbox control was enable.

    How to do that..?
    Waiting for ur reply.

    ReplyDelete
  2. Mansoor

    You can use Check box Properties and you can specify setting Conditional Format or rule for the field .

    Double-click the Check Box control to open its Properties dialog box.
    On the Data tab, in the Field name field type isControlEnabled, select 0 for Value when item is new and 1 for Value when edit, and click OK.


    Thanks
    Disha Shah

    ReplyDelete