G
Geordie
I was wondering what capabilities ASP.Net has at the client level.
I have been using a RadioButtonList.
My control and additional textboxes look like this:
o See item number [ ]
o See items from Date [ ] to date [ ]
I have the method defined for SelectedIndexChanged event. Basically,
I am trying to clear and disable the text selections for the
unselected item.
Example:
private void RadioButtonList1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if (RadioButtonList1.SelectedValue.ToString() == "ItemNumber")
{
txtFromDate.Text = "";
txtToDate.Text = "";
txtFromDate.Enabled = false;
txtToDate.Enabled = false;
txtItemNumber.Enabled = true;
}
}
The problem is that my SelectedIndexChanged event does not fire until
the post. I can set the AutoPost=True, but this is still doing a
post. That seems like a lot of traffic (back to the server and
running code again, etc) just to disable some client level fields. I
should be able to do this all on the client because the server does
not need to know this information.
Well, I could fall back by writing some JScript to do this for me, but
I thought there would be a native way for ASP.Net to handle this.
Does anyone have any ideas?
Thanks in advance!
I have been using a RadioButtonList.
My control and additional textboxes look like this:
o See item number [ ]
o See items from Date [ ] to date [ ]
I have the method defined for SelectedIndexChanged event. Basically,
I am trying to clear and disable the text selections for the
unselected item.
Example:
private void RadioButtonList1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if (RadioButtonList1.SelectedValue.ToString() == "ItemNumber")
{
txtFromDate.Text = "";
txtToDate.Text = "";
txtFromDate.Enabled = false;
txtToDate.Enabled = false;
txtItemNumber.Enabled = true;
}
}
The problem is that my SelectedIndexChanged event does not fire until
the post. I can set the AutoPost=True, but this is still doing a
post. That seems like a lot of traffic (back to the server and
running code again, etc) just to disable some client level fields. I
should be able to do this all on the client because the server does
not need to know this information.
Well, I could fall back by writing some JScript to do this for me, but
I thought there would be a native way for ASP.Net to handle this.
Does anyone have any ideas?
Thanks in advance!