Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problems with TreeView ViewState in ASP.NET 2.0

Reply
Thread Tools

problems with TreeView ViewState in ASP.NET 2.0

 
 
=?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?=
Guest
Posts: n/a
 
      11-08-2006
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:

MasterPage
Content[
UserControl[
Menu,
MultiView[
View1[
TreeView
]
View2[
...
]
]
]

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

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?

Nadav
 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      11-09-2006
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.

Sincerely,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
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
promptly.

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
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

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

 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      11-09-2006
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
understanding.

Regards,
Walter Wang ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with ViewState: "function 'ViewState.get_Item' evaluated and returned null" Steph ASP .Net 2 05-11-2011 02:35 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
Loading usercontrols, viewstate problem, slighly different from all others "viewstate uc problems" please help... ujjc001 ASP .Net 0 07-27-2005 01:52 PM
Viewstate errors... how do I get viewstate working? mark ASP .Net Building Controls 0 02-20-2004 02:17 PM
Corrupted ViewState (Yes, another issue concerning viewstate) Ben Rush ASP .Net 2 12-05-2003 04:17 PM



Advertisments