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

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

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.