p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   Is anybody tell me how to iterate <asp:Checkbox> a (http://p2p.wrox.com/showthread.php?t=34106)

frmsasp October 8th, 2005 12:00 AM

Is anybody tell me how to iterate <asp:Checkbox> a
 
Dear Friend,

Is anybody tell me how to iterate <asp:Checkbox> array loop.

e.g. in PHP

<INPUT TYPE="CHECKBOX" NAME="CHK[]">

I am using foreach loop.


Will you pl guide me for below ASP.Net with C# code.

While (daDetail.Read())
{
   lblLabel.Text += "<input type='checkbox' name='chk[" + daDetail["Module_id"] + i.ToString() + "]' value='A'>Add
}


This will create multiple checkbox. Now I want to know that how to get value of selected checkbox ?


Thanking You,



laithz October 12th, 2005 09:19 AM

While (daDetail.Read())
{
   chkBoxName = "chk[" + daDetail["Module_id"] + i.ToString() + "]";
   lblValues.Text += Request.Form[chkBoxName] + "<br>";
}


Imar October 12th, 2005 10:05 AM

Is this for ASP.NET 2.0, the new ASP.NET version about to be released in November?

If not, please post your question in the 1.x forum, located here:
http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/

If it is for ASP.NET 2.0, can you provide more details? What exactly are you trying to accomplish?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


All times are GMT -4. The time now is 10:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.