什么是回发事件? [英] What is a PostBack Event ?

查看:66
本文介绍了什么是回发事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我什么是回发?
请尝试通过示例进行解释...

谢谢
Akiii

Can anyone tell me what is a PostBack ?
Please try to explain it with an example...

Thanks
Akiii

推荐答案

All Here
I hope the above information will be helpful. If you have more concerns, please let me know.


该页面公开了IsPostBack属性.这是一个只读的Boolean属性,指示是否是第一次加载页面或控件,还是响应客户端的回发而加载页面或控件.仅在第一次加载页面或控件时,才必须执行许多昂贵的操作(例如,从数据库中获取数据或填充ListItems).如果将页面发布到服务器上然后重新加载,则无需重复该操作.通过测试IsPostBack的值,可以跳过昂贵的操作,如示例1和示例2中的代码片段所示.
例子1.在VB.NET中测试IsPostBack
The page exposes the IsPostBack property. This is a read-only Boolean property that indicates if the page or control is being loaded for the first time, or if it is being loaded in response to a client postback. Many expensive operations (such as getting data from a database or populating ListItems) must be performed only the first time the page or control is loaded. If the page is posted to the server and then reloaded, there is no need to repeat the operation. By testing the value of IsPostBack, you can skip the expensive operation, as in the code snippets in Example 1 and Example 2.

Example 1. Testing for IsPostBack in VB.NET
sub Page_Load(ByVal Sender as Object, _
              ByVal e as EventArgs)
   if not IsPostBack then
      '  Do the expensive operations only the
      '  first time the page is loaded.
   end if
end sub
Example 2. Testing for IsPostBack in C#
void Page_Load(Object sender, EventArgs e)
{
   if (! IsPostBack)
   {
      //  Do the expensive operations only the
      //  first time the page is loaded.
   }
}


试试这个链接-[
^ ]


try this link - [^]


签出 msdn [
Check out msdn[^] - you should get some useful information on there.


这篇关于什么是回发事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆