asp.net中的回发属性. [英] Postback Property in asp.net....

查看:73
本文介绍了asp.net中的回发属性.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们单击按钮单击时,包括Page_Load的整个页面是否被回发"?

is the entire page including the Page_Load is ‘posted back‘ when we click on Button click?

推荐答案

单击按钮时,它会导致回发将触发Asp.Net页面的Page_Load事件.

您可以检查它是否是回发的,因此您不会运行仅应在初始加载期间运行的代码.

例如

When you click the button, it causes a PostBack which will trigger the Page_Load event of your Asp.Net page.

You can check to see if it''s a postback though, so you don''t run code that should only run during an initial load.

e.g

private void Page_Load()
{
    if (!IsPostBack)
    {
        // Something that only happens in the first load
    }
}



在这里看看,它描述了ViewState和回发处理

http://delphi.about.com/library/weekly/aa051705a.htm [ ^ ]



Have a look here, which describes ViewState and postback processing

http://delphi.about.com/library/weekly/aa051705a.htm[^]


这篇关于asp.net中的回发属性.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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