For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2004 > Radio Button List assignment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Radio Button List assignment
Priya

2004-03-28, 10:28 pm

Hi Guys,
I know this is a dump question and a simple problem. But I am new to
ASP.NET so finding it difficult to get it work.
Ok here is the problem
I am getting a value from a SQL server View. I have a Radio button
list with values Yes or No . I need to assign the value and make it
selected based on the value of the result from view. How do I do it in
ASP.NET?
Thanks
Priya
Les Matheson

2004-03-28, 10:28 pm

Priya,

Assuming you've named your buttons "btnYes" and "btnNo", one way to
do it is like this:

if (myDatabaseField==true)
btnYes.Checked = true;
else
btnNo.Checked = true;

For this to work (or anything else with radio buttons), both the yes
and no buttons must be members of the same group -- you can set the
Group property in the property window to be any arbitrary string, as
long as its the same for both.

Good luck,
Les Matheson
Integral Concepts, Inc.
http://www.ivsds.com



priyasree@hotmail.com (Priya) wrote in message news:<8f1c1a85.0402231246.46fadcf0@posting.google.com>...
> Hi Guys,
> I know this is a dump question and a simple problem. But I am new to
> ASP.NET so finding it difficult to get it work.
> Ok here is the problem
> I am getting a value from a SQL server View. I have a Radio button
> list with values Yes or No . I need to assign the value and make it
> selected based on the value of the result from view. How do I do it in
> ASP.NET?
> Thanks
> Priya

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com