I am beginner is ASP.NET. I've a small doubt.I've written a simple code to print the text of checked radio button in the textbox.I haven't used the autopostback property for the radio button.The code is as follows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace web
{
public partial class SAMPLE : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton1.Checked)
TextBox1.Text = RadioButton1.Text;
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton2.Checked)
TextBox1.Text = RadioButton2.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
}
checking the radio button, the text in radio button is not printed in the text box, but got printed after hitting the button. My doubt is during the postback(on hitting button) only the contents in button control event handler gets executed but how come the statements in other event handlers got executed?