编程语言
首页 > 编程语言> > 基于ASP.NETAJAX的WebPart开发与部署-转

基于ASP.NETAJAX的WebPart开发与部署-转

作者:互联网

原文链接:http://www.cnblogs.com/dnmidi/archive/2007/10/21/932417.html
 //returningtrueallthetime,somewhatdefeatsthepurposeofthe_spFormOnSubmitWrapper()whichistoblockrepetitivepostbacks,butitallowsMSAJAXExtensionstoworkproperly
               //itsahackthathopefullyhasminimaleffect
               if(this.Page.Form!=null)
               {
                   stringformOnSubmitAtt=this.Page.Form.Attributes["onsubmit"];
                   if(!string.IsNullOrEmpty(formOnSubmitAtt)&&formOnSubmitAtt=="return_spFormOnSubmitWrapper();")
                   {
                       this.Page.Form.Attributes["onsubmit"]="_spFormOnSubmitWrapper();";
                   }

 

                   //addtheScriptManagerasthefirstcontrolinthePage.Form
                   //Idon'tthinkthisactuallymatters,butIdidittobeconsistentwithhowyouaresupposedtoplacetheScriptManagerwhenuseddeclaritevly
                   this.Page.Form.Controls.AddAt(0,_AjaxManager);
               }
           }
       }
       #endregion

       #regionProperties
       ///<summary>
       ///ExposesthePage'sscriptmanager.ThevalueisnotsetuntilafterOnInit
       ///</summary>
       [WebPartStorage(Storage.None)]
       publicScriptManagerAjaxManager
       {
           get{return_AjaxManager;}
           set{_AjaxManager=value;}
       }
       #endregion
   }
开发时只要继承这个WebPart就可以添加UpdatePanel,并在里面添加其他控件了。

转载于:https://www.cnblogs.com/dnmidi/archive/2007/10/21/932417.html

标签:Web,WebPart,ASP,usingSystem,NETAJAX,ErrorContainer,添加,AjaxManager,cv
来源: https://blog.csdn.net/weixin_30814329/article/details/95949424