Radio Button at Run Time

Results 1 to 2 of 2

Thread: Radio Button at Run Time

  1. #1
    Join Date
    Dec 1969

    Default Radio Button at Run Time

    Hi guys…I’d like to know if you could help me…I’ve the following code…(below)..I have a datareader..when it loops my table it generates the radio buttons dynamically according to the data in my table on page load…on the same page I have a update button…but I do not know how to get/set(I tried) the value of each radio button dynamically.. how can I do it in order to update a table.??? I will really be grateful..many email is<BR> thnaks<BR><BR> <BR><BR>private void Page_Init(object sender, System.EventArgs e)<BR><BR>{<BR><BR> <BR><BR>readAnswers = ConnectDB.runSQL("select * from Answer where pollid="+PollID.ToString()); <BR><BR>int y=0;<BR><BR>while(readAnswers.Read()) <BR><BR>{ <BR><BR>RadioButton myRadio = new RadioButton();<BR><BR>myRadio.Checked = false;<BR><BR>myRadio.GroupName = "Group";<BR><BR>myRadio.ID = readAnswers["AnswerID"].ToString();<BR><BR>myRadio.Visible = true;<BR><BR>myRadio.Width = 120;<BR><BR>myRadio.BackColor = Color.Beige; <BR><BR>myRadio.Text = readAnswers["Answers"].ToString(); <BR><BR>}<BR><BR>}<BR>

  2. #2
    Join Date
    Dec 1969

    Default well for one thing

    you need to "add" the control somewhere<BR><BR>do you have a placeholder or something to be the location to place the controls? that&#039;s the only step you **seem** to be missing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts