well, I want to make a loop that displays the same radio button over and over again. I cant figure out how to display code with tags on this forum to show what I mean.
You can do this way, just add a panel, then create a radioButtonlist control, then add your repeating wrod as like item to radiobuttonlist, finally add the radio button list to panel.
patrickRank #4,458 · 342 reputationPosted Oct 20, 2009, 11:05 AM EDT
0
Kirtan, let me put it this way: in php, i could use 'echo' in a for loop to make 10 table rows. I want to do the same thing, only in asp and instead of a table row, i want to make 10 asp:radiobutton controls. I think the panel thing the other people have suggested might work, let me know if there is a better way you know of.
0
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 20, 2009, 11:09 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 20, 2009, 11:25 AM EDT
llike below code
<%
for (int i = 0; i <= 10; i++)
{
RadioButton rb = new RadioButton();
rb.ID = "RadioButton" + i.ToString();
rb.Text = "RadioButton" + i.ToString();
Page.Form.Controls.Add(rb);
}
%>
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 19, 2009, 1:01 PM EDT
what do you mean by showing gorup of radio buttons ??? ?
Roei BarRank #1,271 · 1.4K reputationPosted Oct 19, 2009, 1:26 PM EDT
put an asp panel
and in code behind
for (i=0;i<5;i++)
{
this.pnlRadio.Controls.Add(new RadioButton());
}
patrickRank #4,458 · 342 reputationPosted Oct 19, 2009, 1:27 PM EDT
patrickRank #4,458 · 342 reputationPosted Oct 19, 2009, 1:30 PM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 19, 2009, 1:33 PM EDT
mail id = [email protected]
if you can explain here mail me :)
Master BillaRank #2,229 · 630 reputationPosted Oct 19, 2009, 5:07 PM EDT
You can do this way, just add a panel, then create a radioButtonlist control, then add your repeating wrod as like item to radiobuttonlist,
finally add the radio button list to panel.
thank you
patrickRank #4,458 · 342 reputationPosted Oct 20, 2009, 11:05 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 20, 2009, 11:09 AM EDT
for (int i = 0; i <= 10; i++)
{
RadioButton rb = new RadioButton();
rb.ID = "RadioButton" + i.ToString();
rb.Text = "RadioButton" + i.ToString();
Page.Form.Controls.Add(rb);
}
patrickRank #4,458 · 342 reputationPosted Oct 20, 2009, 11:11 AM EDT
patrickRank #4,458 · 342 reputationPosted Oct 20, 2009, 11:30 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 20, 2009, 11:36 AM EDT
you can also place whole page_load function in
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts