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

problems with TreeView ViewState in ASP.NET 2.0

P: n/a
Hi Everybody,

I've got a strange problem with TreeView Control in ASP.NET.

The Controls Tree I've got on my page is like this:


The Menu control has two items that switch between the two Views in the
MultiView (I'm setting MultiView.ActiveViewIndex in the MenuItemClick event

Now, The problem happens when I select a node in the tree, click on the menu
item to move to View2, and the I click on the menu item to come back to View2.

In the MenuItemEvent handler, TreeView1.SelectedItem is null!

But, when the page is displayed the node that was selected before I moved to
the other view is displayed as selected!

I looks as if the ViewState of the Tree is restored AFTER the MenuItemClick
handler is called!

Has anybody ran across this problem before?

Nov 8 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Hi Nadav,

I've tried to create a simple test web site using the steps you described,
however I didn't see the issue on my side. Would you please send me a
reproducible project? Thanks.

By the way, normally if you could provide some more complete code while
asking the question, it might help you get the answers more quickly.

Walter Wang (wa****, remove 'online.')
Microsoft Online Community Support

Get notification to my posts through email? Please refer to
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 9 '06 #2

P: n/a
Hi Nadav,

Thank you for your sample project. I was able to reproduce the issue using
your code. Currently I'm doing more research and will get back to you as
soon as I got more information. Thank you for your patience and

Walter Wang (wa****, remove 'online.')
Microsoft Online Community Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.