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
Mats A
NA
59
28.6k
page lifecyle and clickevent
Apr 8 2011 2:40 AM
I have som buttons i add dynamically to my page. When clicked on the first time it works fine and the method is called, as I click on a different button after that I have to click twice to make the method call. Does anyone now why.
On page load (!Page.IsPostback) I build the table and the linkbuttons it contains and display it.
LinkButton btn = new LinkButton();
btn.Text = row.ItemArray[0].ToString();
btn.CommandName = "ID";
btn.CommandArgument = row.ItemArray[0].ToString();
btn.Command += new CommandEventHandler(test);
When a button is clicked the first time it works fine, when a second button is clicked nothings happens, it has to be clicked twice. Any ideas?
On (Page.isPostback) i recreate the table after it has been changed in the "test" method (that has been called by the command).
So why is the method not called as a button is clicked after the first click..
Reply
Answers (
3
)
Custom URL for My Website
How to Get child control In Datalist?