Sign in to follow this  
Alpha_ProgDes

[.net] Wrong Event getting triggered???

Recommended Posts

I have a page with a treeview in an updatepanel. A tabcontainer. Each tab panel has an UpdatePanel. Each UpdatePanel has an usercontrol in it. Ok. Now my TreeView is an asyncpostback trigger for the updatepanel of one of my updatepanels. When I click a node, the selectedvalue should show in the label of that usercontrol. But for some reason, I have to click it twice, for the value to show properly. If I click once, then the selectedvalue of the previous selected node is shown. When I run it through the debugger, the page load event of my usercontrol comes up first. I thought the selectednodechanged event of my main page should be the first event showing in the debugger. Why is that? What am I not understanding about the life cycle? Or ASP.NET in general?

Share this post


Link to post
Share on other sites
It's somewhat confusing without a picture or something, but...

The events fired by controls happens AFTER the page load. If the you want the value updated after the click create a hidden field or javascript to get the value.

I could have misunderstood your question though.

Nick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this