RadioButton GroupName does not work !

M

Mick

Hi,
Got a repeater which display question answers and which contains a
placeholder.
In the ItemDataBound Event, I insert a Radio Button for each answer and set
their GroupName with the Question Id.
Anyway, when I display my aspx page, I can check ALL radio buttons at same
time !

What am I doing wrong?

*****
PlaceHolder plh = (PlaceHolder)CurrentItem.Controls[1];
System.Web.UI.WebControls.RadioButton NewRadio = new RadioButton();

NewRadio.ID="ClientCompanyTestQcmQuestionRadioPropositon";

NewRadio.GroupName=CurrentP.Question_PropositionParent.Id;

NewRadio.Checked= false;

plh.Controls.Add(NewRadio);

*****

Thanks for help ^^
 
M

Mick

Thks ^^
'll have a look

Saravana said:
This is a known bug in asp.net. This problem occurs because the Repeater
server control implements the INamingContainer interface, which requires
that all controls that are nested within it must have a unique name when
rendered in Hypertext Markup Language (HTML). Therefore, the HTML name
attribute of any rendered child server control is unique. For more details,
refer this link
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316495

Instead of asp.net radion button control, you can use this control
http://www.metabuilders.com/Tools/RowSelectorColumn.aspx

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com


Mick said:
Hi,
Got a repeater which display question answers and which contains a
placeholder.
In the ItemDataBound Event, I insert a Radio Button for each answer and set
their GroupName with the Question Id.
Anyway, when I display my aspx page, I can check ALL radio buttons at same
time !

What am I doing wrong?

*****
PlaceHolder plh = (PlaceHolder)CurrentItem.Controls[1];
System.Web.UI.WebControls.RadioButton NewRadio = new RadioButton();

NewRadio.ID="ClientCompanyTestQcmQuestionRadioPropositon";

NewRadio.GroupName=CurrentP.Question_PropositionParent.Id;

NewRadio.Checked= false;

plh.Controls.Add(NewRadio);

*****

Thanks for help ^^
 
S

Saravana

This is a known bug in asp.net. This problem occurs because the Repeater
server control implements the INamingContainer interface, which requires
that all controls that are nested within it must have a unique name when
rendered in Hypertext Markup Language (HTML). Therefore, the HTML name
attribute of any rendered child server control is unique. For more details,
refer this link
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316495

Instead of asp.net radion button control, you can use this control
http://www.metabuilders.com/Tools/RowSelectorColumn.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top