Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Radio button problem

Status
Not open for further replies.

lesliedomjones

Programmer
Feb 4, 2003
3
IN
hello all,
I have two webforms radio buttons in a same group. Through Code I am setting second radio button as checked by default. ie, In ASPX page it looks like as shown below..

<asp:RadioButton id=&quot;rdoSOne&quot; runat=&quot;server&quot; Text=&quot;ServerOne&quot; GroupName=&quot;groupname&quot;></asp:RadioButton>

<asp:RadioButton id=&quot;rdoSTwo&quot; runat=&quot;server&quot; Text=&quot;ServerOne&quot; Checked=&quot;True&quot; GroupName=&quot;groupname&quot;></asp:RadioButton>

now through code (ie, in CS file) I am trying to change the status of the radio button by giving the code as shown below.

rdoSOne.Checked = true;

But it is not working.. But if I explicity give

rdoSOne.Checked = true;
rdoSTwo.Checked = false;

It is working fine.. I know the problem. But I dont know is there any other way by which this problem can be overcome? Or is it a dotnet bug? Experts please help me...

Thanks in advance...

Regards,
leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top