Check box from server - Need experts answer [Resolved]

Posted by Sathya4260 under ASP.NET on 1/5/2011 | Points: 10 | Views : 1136 | Status : [Member] | Replies : 2
hi everyone,

I need to create dynamically check box with the text value from the server,

That is from server, the total no. and value would be fetched, I need to create the total no. of checkbox along with the text value .

Kindly help me soon...

Sathish Kumar S


Responses

Posted by: T.saravanan on: 1/5/2011 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Refer the following code.....
Add a panel control in a page.

panel1 --> Panel control

int n = int.Parse("5");
for(int x=1; x<=n; x++)
{
CheckBox chk = new CheckBox();
chk.ID = "chk"+x;
chk.Text = "chk"+x;
chk.Checked = false;
panel1.Controls.Add(chk);
}

As per your requirement change this code.

Cheers :)


Thanks,
T.Saravanan

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 1/5/2011 [Member] Starter | Points: 25

Up
0
Down
Really nice, it helped me....

Sathish Kumar S

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response