Tutorials
Resources
Forum
Communities
Interview
Jobs
Projects
Training
ASP.NET Web Hosting
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Devendra
(140)
R.Jaya kumar ...
(119)
Ashok
(96)
Last 7 Days
UltimateRengan
(997)
Ashok Babu ...
(797)
Viji RAJKUMAR
(685)
more...
Play
Silverlight Games
or
Submit your Silverlight applications
and earn 90% AdSense revenue.
New Feature:
Community Sites
:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
Forums
»
.NET
»
ASP.NET
»
action event for dynamic checkbox control
Posted Date:
20 Sep 2008
Posted By:
newtodev
Member Level:
Silver
Points
: 1
Responses:
1
I have created a list of dynamic checkbox and textbox corresponding to each checkbox.
The textboxes by default would be readonly mode.
On chkedchanged event the corresponsponding textbox shd get enabled.
The following is the piece of code.
for (int i = 1; i <= 2; i++)
{
objtableCell1 = new TableCell();
CheckBox chkbox = new CheckBox();
TextBox txtbox = new TextBox();
if (i == 1)
{
objtableCell1.HorizontalAlign = HorizontalAlign.Left;
objtableCell1.VerticalAlign = VerticalAlign.Top;
objtableCell1.Height = Unit.Pixel(10);
chkbox.ID = "chkbox" + j + i;
chkbox.Width = Unit.Pixel(400); chkbox.AutoPostBack = true; chkbox.CheckedChanged = callfunct(j) ; chkbox.Text = Convert.ToString(ds.Tables[0].Rows[j - 1]["disbursement"]); objtableCell1.Controls.Add(chkbox); objTableRow1.Cells.Add(objtableCell1);
objtableCell1 = new TableCell();
objTable1.Rows.Add(objTableRow1);
void callfunct(int l)
{
}
}
else if (i == 2)
{
objtableCell1.HorizontalAlign = HorizontalAlign.Left;
objtableCell1.VerticalAlign = VerticalAlign.Top;
objtableCell1.Height = Unit.Pixel(10);
txtbox.ID = "txtBox" + j + i;
txtbox.ID = "txtBox" + j + i; txtbox.Width = Unit.Pixel(100); txtbox.EnableViewState = true; txtbox.ReadOnly = true; objtableCell1.Controls.Add(txtbox); objTableRow1.Cells.Add(objtableCell1);
objtableCell1 = new TableCell();
objTable1.Rows.Add(objTableRow1);
}
Responses
Author:
Elayaraja.K
22 Sep 2008
Member Level:
Silver
Rating:
Points
: 1
you can add action event using this.
chkbox.Attributes.Add("click","fnc_Chkbox_click();")
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Next :
TreeView Control
Previous :
Email vaildation
Return to Discussion Forum
Post New Message
Category:
ASP.NET
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use