none
How can I allow AJAX option in custom web part for SharePoint 2010?

Respostas

  • This is probably built into the web part and is not a general configuration setting for all web parts. Most likely you will need to add a script manager to the page (or master page) and then have your update panel within the actual web part. You also might be able to put the script manager in the web part, but it is generally a better idea to put it on the masterpage/page because you will see errors if there is more than one on a page.
    terça-feira, 23 de março de 2010 20:17
  • ScriptManager scriptmgr = ScriptManager.GetCurrent(this.Page);
    if (scriptmgr == null)
    {
         scriptmgr = new ScriptManager();
         if (this.Page.Form != null)
         {
               this.Page.Form.Controls.AddAt(0, scriptmgr);
         }
    }

    You can dynamically add it to the page as well. First check if it exists and if it does not. Add it as the first control on the form.

     

    David Opdendries
    -----------------------
    blog

    quarta-feira, 24 de março de 2010 08:00

Todas as Respostas

  • This is probably built into the web part and is not a general configuration setting for all web parts. Most likely you will need to add a script manager to the page (or master page) and then have your update panel within the actual web part. You also might be able to put the script manager in the web part, but it is generally a better idea to put it on the masterpage/page because you will see errors if there is more than one on a page.
    terça-feira, 23 de março de 2010 20:17
  • Thank you for your advice ^^
    .NET Beginner 3.5
    quarta-feira, 24 de março de 2010 03:41
  • ScriptManager scriptmgr = ScriptManager.GetCurrent(this.Page);
    if (scriptmgr == null)
    {
         scriptmgr = new ScriptManager();
         if (this.Page.Form != null)
         {
               this.Page.Form.Controls.AddAt(0, scriptmgr);
         }
    }

    You can dynamically add it to the page as well. First check if it exists and if it does not. Add it as the first control on the form.

     

    David Opdendries
    -----------------------
    blog

    quarta-feira, 24 de março de 2010 08:00