469,140 Members | 1,216 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

Event associate is lost if link button is created outside of page_load

Hi,

I create a tree view. Each node has link button associate with it, which includes add, edit, delete buttons. The way I did is for users who have very low capablity of using computer. Now I encoutered problem. At certain situation the event does not fire when I click my link button.

I generate my tree and link button on fly, and associate event with button. Tree is in my top panel. Detail information of each node is in my bottom panel. I create tree in page_load function. In my detail information panel I have save button which does add and update function. If I update my data, my top tree panel won't get updated. Because server executes page_load first, then button click event.

So I create another function call RefreshPage. Basically it does same thing as page_load. But since it is outside of page_load function, every link button I ceated inside this function lost its event. It seems link button only has event associated with while it was created within page_load function.

Is there anyway for me to update my treeview and at the same time I still can fire event from my link button?

Here is my basic structure.

private sub Page_Load(sender, e)
'get data from database and build treeview
end sub

private sub RefreshPage()
'get data from database and build treeview
end sub

sub btnAdd_Click(sender, e)
'add data to database
'call RefreshPage()
end sub

Thank you,
Dailan

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #1
0 1307

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by tony kulik | last post: by
8 posts views Thread by Donald Xie | last post: by
reply views Thread by Demetri | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.