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!

Re: ASP.Net and client side control (SelectedIndexChanged) by Vaibhav

Vaibhav
Fri Aug 29 11:32:30 CDT 2003

If you dont want to post back then, client side JScript is the only option
you have.

"Geordie" <geordie.teicher@abboptical.com> wrote in message
news:73b5ffcf.0308290735.2eac298a@posting.google.com...
> 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!



Re: ASP.Net and client side control (SelectedIndexChanged) by Kevin

Kevin
Fri Aug 29 12:03:22 CDT 2003

Another option is to use HTML Radio Buttons.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Vaibhav" <consultvaibhav@yahoo.com> wrote in message
news:ewegmskbDHA.2820@tk2msftngp13.phx.gbl...
> If you dont want to post back then, client side JScript is the only
option
> you have.
>
> "Geordie" <geordie.teicher@abboptical.com> wrote in message
> news:73b5ffcf.0308290735.2eac298a@posting.google.com...
> > 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!
>
>