problems with TreeView ViewState in ASP.NET 2.0

Discussion in 'ASP .Net' started by =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?=, Nov 8, 2006.

  1. 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
     
    =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?=, Nov 8, 2006
    #1
    1. Advertising

  2. 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 (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Nov 9, 2006
    #2
    1. Advertising

  3. 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 (, 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.
     
    Walter Wang [MSFT], Nov 9, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Rush
    Replies:
    2
    Views:
    574
    Ben Rush
    Dec 5, 2003
  2. Steph
    Replies:
    2
    Views:
    1,696
    heislord5
    May 11, 2011
  3. ujjc001
    Replies:
    0
    Views:
    1,399
    ujjc001
    Jul 27, 2005
  4. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,637
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  5. sck10
    Replies:
    6
    Views:
    957
    sck10
    Sep 1, 2006
Loading...

Share This Page