Click here to Skip to main content
15,886,074 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
     <input type="text" name="TextBox1" />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />


Click Button1
Click Button1
Click Button1
you will find TextBox1.Text is changed,what makes it change?
Posted
Comments
[no name] 13-Oct-12 23:17pm    
Do you think that it's possible that whatever happens is located in "Button1_Click"?
happy_daily 14-Oct-12 8:17am    
If you click button,you will find TextBox1.Text changes to ',', with the button1_chlick() has nothing,just try
[no name] 14-Oct-12 8:33am    
No.... no it does not.
happy_daily 14-Oct-12 9:23am    
Are u sure? Do u try it? I have tried it on different computers, and find the textbox1.text changed strangely.
happy_daily 14-Oct-12 8:18am    
If you click button,you will find TextBox1.Text changes to ',', with the button1_chlick() has nothing,just try

1 solution

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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900