单击按钮时会发生什么? [英] What happened when button click?

查看:110
本文介绍了单击按钮时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
     <input type="text" name="TextBox1" />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />



单击Button1
单击Button1
单击Button1
您会发现TextBox1.Text被更改了,它是由什么来改变的?



Click Button1
Click Button1
Click Button1
you will find TextBox1.Text is changed,what makes it change?

推荐答案

听起来像您在询问单击按钮时文本框文本如何更改.

好吧,当单击按钮时,将发生页面回发,并执行定义的事件(如果发生的话).无论事件方法中提到什么,代码都会执行,并且可以看到呈现的页面上的更改.

要了解如何合理地进行页面流动的全部内部细节,请阅读:
ASP的完整生命周期.网页和控件 [ ASP.NET应用程序和页面生命周期 [ ^ ]
MSDN:ASP.NET页面生命周期概述 [
Sounds like you are asking how does textbox text change when button is clicked.

Well, when button is clicked, page postback happens and event defined if occured executes. Whatever is mentioned in the event method, code executes and one can see the changes on page rendered.

To know the full inner details on how and what happens page flow wise, read:
Complete Lifecycle of an ASP.Net page and controls[^]
ASP.NET Application and Page Life Cycle[^]
MSDN: ASP.NET Page Life Cycle Overview[^]


这篇关于单击按钮时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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