TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pramod Kumar Nandagiri
NA
484
0
how to fire the checked changed event for all the checkboxes which r created dynamiclly an a aspx page
May 20 2010 2:31 AM
hi i created one check box dynamically and added to table like bellow
CheckBox chk=new CheckBox();
chk.AutoPostBack = true;
chk.CheckedChanged += new EventHandler(chk_CheckedChanged);
tbcell3.Controls.Add(chk);
tbrow1.Cells.Add(tbcell3);
tbl.Controls.Add(tbrow1);
this.Controls.Add(tbl);
like this the check box was created dynamically now i want to write the code in chk_checkedchanged event,i tried with the bellow code it's working fine
void chk_CheckedChanged(object sender, EventArgs e)
{
tbl.BackColor = Color.Black;
}
if if kept the above code in for loop like bellow
for(int i=0;i<3;i++)
{
hi i created one check box dynamically and added to table like bellow
CheckBox chk=new CheckBox();
chk.AutoPostBack = true;
chk.CheckedChanged += new EventHandler(chk_CheckedChanged);
tbcell3.Controls.Add(chk);
tbrow1.Cells.Add(tbcell3);
tbl.Controls.Add(tbrow1);
this.Controls.Add(tbl);
}
Then on the form 3 check box controls will be created , and the checked changed event was working for the last check box, but i want the checked changed event should work for every check box wich is created dynamically with the above code
Reply
Answers (
1
)
.net basics
how to validate a listbox is empty or with data