T
Tony Johansson
Hello!
In the code-behind file I have this event handler
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitPositionRole();
}
}
I have also four event handler in the code-behind file see below. One for
each radio button. All four are in the same Group.
When I change the radio button the event handler is called.
Now to my question. What seems strange here is that the event hadler
Page_Load is called before the event handler for the
radio_button. I have thought that the Page_Load should be called as the last
event handler.
For example if I change the radio button from worker radiobutton to
bossButton the following happen.
1. Page_load will be called.
2. Event handler bossButton_CheckedChanged is called
So can somebody explain why the Page_Load is called as the first event
handler ?
protected void workerButton_CheckedChanged(object sender, EventArgs e)
{
InitPositionRole();
}
protected void bossButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = true;
positionRole.Items.Add("General Manager");
positionRole.Items.Add("Project Manager");
}
protected void vpButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = true;
positionRole.Items.Add("VP Sales");
positionRole.Items.Add("VP Marketing");
positionRole.Items.Add("VP Production");
positionRole.Items.Add("VP Human Resources");
}
protected void presidentButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = false;
}
In the code-behind file I have this event handler
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitPositionRole();
}
}
I have also four event handler in the code-behind file see below. One for
each radio button. All four are in the same Group.
When I change the radio button the event handler is called.
Now to my question. What seems strange here is that the event hadler
Page_Load is called before the event handler for the
radio_button. I have thought that the Page_Load should be called as the last
event handler.
For example if I change the radio button from worker radiobutton to
bossButton the following happen.
1. Page_load will be called.
2. Event handler bossButton_CheckedChanged is called
So can somebody explain why the Page_Load is called as the first event
handler ?
protected void workerButton_CheckedChanged(object sender, EventArgs e)
{
InitPositionRole();
}
protected void bossButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = true;
positionRole.Items.Add("General Manager");
positionRole.Items.Add("Project Manager");
}
protected void vpButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = true;
positionRole.Items.Add("VP Sales");
positionRole.Items.Add("VP Marketing");
positionRole.Items.Add("VP Production");
positionRole.Items.Add("VP Human Resources");
}
protected void presidentButton_CheckedChanged(object sender, EventArgs e)
{
positionRole.Items.Clear();
positionRole.Enabled = false;
}