ASP.NET TreeView control bug with NavigateUrl and Target

Discussion in 'ASP .Net Web Controls' started by PerG, May 27, 2008.

  1. PerG

    PerG Guest

    Hi all,

    I have a problem with the ASP.NET 2.0 TreeView Control.

    I have added some TreeNodes to my TreeView that has NavigationUrl set to a
    webpage, Target set to "_blank" (a new windows) and SelectionMode set to
    "Select". Then I added some other nodes that doesn't have NavigationUrl set
    ("regular" nodes).

    When I first click a "regular" node and the page postbacks I read the
    SelectedNode property and do whatever I need. Next, if I click a node with
    NavigationUrl and Target set, the TreeView seems to be using javascript to
    mark the node as selected (in the GUI, both nodes seems selected). It does
    not postback and trigger the SelectedNodeChanged event but when my main page
    postbacks (when I click a button or whatever) the SelectedNode property on
    the TreeView is now changed to the node with NavigationUrl set.

    This might be the intention of the .NET Framework, but it seems a little
    strange since I want the nodes with NavigationUrl set to be "Navigation Only"
    and not interfere with the regular nodes.

    I tried to make a custom TreeView and TreeNode class, setting the nodes
    selectionmode to "None" and then overriding the RenderPreText and
    RenderPostText to render my own A-tag with correct Href- and
    Target-attribute, but unfortunately I cannot access Css and Style attributes
    and some other vital functions to render on my custom node like the regular
    nodes since Microsoft has made all theese properties internal or private (I
    checked them with reflector).

    Does anyone have a better solution. Should this be considered a bug? If so,
    where do I report this?

    Regards,
    Per
     
    PerG, May 27, 2008
    #1
    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. Replies:
    4
    Views:
    3,132
    fabio.medeiros
    Sep 21, 2007
  2. Replies:
    1
    Views:
    596
    =?Utf-8?B?RWx0b24gVw==?=
    Mar 8, 2006
  3. mohit
    Replies:
    0
    Views:
    565
    mohit
    Jan 23, 2008
  4. hjp
    Replies:
    0
    Views:
    150
  5. Arthur Dent

    HyperLink control; NavigateUrl; IE vs. Mozilla

    Arthur Dent, Sep 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    163
    clintonG
    Sep 30, 2005
Loading...

Share This Page