By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,646 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,646 IT Pros & Developers. It's quick & easy.

linkbutton click event dont fire evaenthandler - ASP.NET

P: 1
Hi,
I couldnt find a solution to my problem. I created linkbutton dynamically and also add an eventhandler dynamically. However when i click the button an empty page is reloaded. My guess is, my freshly created linkbuttons dont have an eventhandler. What can i do for this problem?
My code:
protected void BransClick(object sender, EventArgs e)
{
while (reader.Read())
{
LinkButton ogretmen;
ogretmen = new LinkButton();
ogretmen.ID =reader[0].ToString();
ogretmen.Click += new EventHandler(IdareClick);
ogretmen.Text = reader[1].ToString() + " " + reader[2].ToString();
cell = new TableCell();
cell.Controls.Add(ogretmen);
row = new TableRow();
row.Controls.Add(cell);
Table1.Controls.Add(row);
}
}

Note:IdareClick method is defined below this code.
Mar 30 '08 #1
Share this Question
Share on Google+
1 Reply


DrBunchman
Expert 100+
P: 979
Hi netman,

Just so as you know, this is a Classic ASP forum. You'll receive better technical help if you post any future questions in the .NET forum.

You can check whether your event handler is firing by sticking a breakpoint at the beginning of the IdareClick method. Does it fire?

Dr B
Mar 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.