Home All Groups Group Topic Archive Search About
Author
9 Jun 2005 1:48 PM
UJ
I have a placeholder where I dynamically add radio buttons based on values
from a DB. It's all one group. How can I access them so that I know which
one is selected?

I've tried both input type="radio" and asp:radiobutton

I can't seem to add a checked.changed event to the radiobutton and when I
search through the assorted controls on the page, I can't find the control
anywhere (through code.)

TIA - Jeffrey.

Author
9 Jun 2005 5:09 PM
Brock Allen
This is all possible. When there is a postback you need to recreate the same
controls that you had previouly dynamically created. Here's a sample that
shuld get you started:

http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/5e4ba4cfe5902a4b/a5717a97bd32c450?q=brock+dynamic+controls+viewstate&rnum=1

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I have a placeholder where I dynamically add radio buttons based on
> values from a DB. It's all one group. How can I access them so that I
> know which one is selected?
>
> I've tried both input type="radio" and asp:radiobutton
>
> I can't seem to add a checked.changed event to the radiobutton and
> when I search through the assorted controls on the page, I can't find
> the control anywhere (through code.)
>
> TIA - Jeffrey.
>
Author
9 Jun 2005 5:56 PM
UJ
Brock,
Thanks I think. But that doesn't really answer my question. I have the
creation of the radiobuttons working fine. The problem is - I need to know
which radio button is selected.

Any suggestions?

TIA.

Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:862305632539193679599456@msnews.microsoft.com...
> This is all possible. When there is a postback you need to recreate the
> same controls that you had previouly dynamically created. Here's a sample
> that shuld get you started:
>
> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/5e4ba4cfe5902a4b/a5717a97bd32c450?q=brock+dynamic+controls+viewstate&rnum=1
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> I have a placeholder where I dynamically add radio buttons based on
>> values from a DB. It's all one group. How can I access them so that I
>> know which one is selected?
>>
>> I've tried both input type="radio" and asp:radiobutton
>>
>> I can't seem to add a checked.changed event to the radiobutton and
>> when I search through the assorted controls on the page, I can't find
>> the control anywhere (through code.)
>>
>> TIA - Jeffrey.
>>
>
>
>
Author
9 Jun 2005 6:35 PM
Brock Allen
When you dynamically create them handle the SelectedindexChanged event. The
first paramater is the sender of the event, which will be your RadioButtonList.
Or am I still missing what you're trying to do?

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> Brock,
> Thanks I think. But that doesn't really answer my question. I have the
> creation of the radiobuttons working fine. The problem is - I need to
> know
> which radio button is selected.
> Any suggestions?
>
> TIA.
>
> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
> news:862305632539193679599456@msnews.microsoft.com...
>
>> This is all possible. When there is a postback you need to recreate
>> the same controls that you had previouly dynamically created. Here's
>> a sample that shuld get you started:
>>
>> http://groups-beta.google.com/group/microsoft.public.dotnet.framework
>> .aspnet/browse_thread/thread/5e4ba4cfe5902a4b/a5717a97bd32c450?q=broc
>> k+dynamic+controls+viewstate&rnum=1
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> I have a placeholder where I dynamically add radio buttons based on
>>> values from a DB. It's all one group. How can I access them so that
>>> I know which one is selected?
>>>
>>> I've tried both input type="radio" and asp:radiobutton
>>>
>>> I can't seem to add a checked.changed event to the radiobutton and
>>> when I search through the assorted controls on the page, I can't
>>> find the control anywhere (through code.)
>>>
>>> TIA - Jeffrey.
>>>
Author
10 Jun 2005 1:00 PM
UJ
I'm not using a radiobuttonlist - I have a series of radio buttons. The
reason for the individual radio buttons is that I need more layout control
than what a radiobuttonlist will give me.

Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:863020632539245091025456@msnews.microsoft.com...
> When you dynamically create them handle the SelectedindexChanged event.
> The first paramater is the sender of the event, which will be your
> RadioButtonList. Or am I still missing what you're trying to do?
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> Brock,
>> Thanks I think. But that doesn't really answer my question. I have the
>> creation of the radiobuttons working fine. The problem is - I need to
>> know
>> which radio button is selected.
>> Any suggestions?
>>
>> TIA.
>>
>> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
>> news:862305632539193679599456@msnews.microsoft.com...
>>
>>> This is all possible. When there is a postback you need to recreate
>>> the same controls that you had previouly dynamically created. Here's
>>> a sample that shuld get you started:
>>>
>>> http://groups-beta.google.com/group/microsoft.public.dotnet.framework
>>> .aspnet/browse_thread/thread/5e4ba4cfe5902a4b/a5717a97bd32c450?q=broc
>>> k+dynamic+controls+viewstate&rnum=1
>>>
>>> -Brock
>>> DevelopMentor
>>> http://staff.develop.com/ballen
>>>> I have a placeholder where I dynamically add radio buttons based on
>>>> values from a DB. It's all one group. How can I access them so that
>>>> I know which one is selected?
>>>>
>>>> I've tried both input type="radio" and asp:radiobutton
>>>>
>>>> I can't seem to add a checked.changed event to the radiobutton and
>>>> when I search through the assorted controls on the page, I can't
>>>> find the control anywhere (through code.)
>>>>
>>>> TIA - Jeffrey.
>>>>
>
>
>
Author
10 Jun 2005 5:58 PM
Brock Allen
So you can handle the OnCheckChanged event for the RadioButton, and in the
event handler the first parameter is the sender which is the RadioButton
that was checked. I hope this helps?

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I'm not using a radiobuttonlist - I have a series of radio buttons.
> The reason for the individual radio buttons is that I need more layout
> control than what a radiobuttonlist will give me.
>
> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
> news:863020632539245091025456@msnews.microsoft.com...
>
>> When you dynamically create them handle the SelectedindexChanged
>> event. The first paramater is the sender of the event, which will be
>> your RadioButtonList. Or am I still missing what you're trying to do?
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> Brock,
>>> Thanks I think. But that doesn't really answer my question. I have
>>> the
>>> creation of the radiobuttons working fine. The problem is - I need
>>> to
>>> know
>>> which radio button is selected.
>>> Any suggestions?
>>> TIA.
>>>
>>> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
>>> news:862305632539193679599456@msnews.microsoft.com...
>>>
>>>> This is all possible. When there is a postback you need to recreate
>>>> the same controls that you had previouly dynamically created.
>>>> Here's a sample that shuld get you started:
>>>>
>>>> http://groups-beta.google.com/group/microsoft.public.dotnet.framewo
>>>> rk
>>>> .aspnet/browse_thread/thread/5e4ba4cfe5902a4b/a5717a97bd32c450?q=br
>>>> oc k+dynamic+controls+viewstate&rnum=1
>>>>
>>>> -Brock
>>>> DevelopMentor
>>>> http://staff.develop.com/ballen
>>>>> I have a placeholder where I dynamically add radio buttons based
>>>>> on values from a DB. It's all one group. How can I access them so
>>>>> that I know which one is selected?
>>>>>
>>>>> I've tried both input type="radio" and asp:radiobutton
>>>>>
>>>>> I can't seem to add a checked.changed event to the radiobutton and
>>>>> when I search through the assorted controls on the page, I can't
>>>>> find the control anywhere (through code.)
>>>>>
>>>>> TIA - Jeffrey.
>>>>>