Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)归海一刀
published in(发表于) 2014/1/30 0:51:57
Asp.Net,Ajax,学习笔记3,UpdatePanel的使用(上)_[Asp.Net教程]

Asp.Net Ajax 学习笔记3 UpdatePanel的使用(上)_[Asp.Net教程]

UpdatePanel可以通过服务端代码来控制如何提交数据和更新UpdatePanel。首先在页面加载的时候注册异步回传或同步回传的提交按钮


ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(this.Button1);
ScriptManager.GetCurrent(this).RegisterPostBackControl(this.Button2);
那么在回传按钮的提交事件中直接调用UpdatePanel的Update方法即可。GetCurrent方法时得到此页面的ScriptManager对象。


UpdateProgress的使用。顾名思义,UpdateProgress用来显示在UpdatePanel更新时,用来表示UpdatePanel更新进度的。在UpdateProgress中有ProgressTemplate的一对标记,用来作为文字或控件的容器,以此来表示UpdatePanel更新的进度。UpdateProgress的DynamicLayout的属性,DynamicLayout属性:隐藏时是否占位,默认值为true。DisplayAfter属性表明在多少毫秒之后,UpdateProgress会显示出来。


ScriptManager可以注册客户端js方法,并同时可以调用。他与ClientScriptManager有所不同,在使用UpdatePanel响应的事件中ClientScriptManager注册的js将不会被调用。








If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759