Asp:TreeView

Discussion in 'ASP .Net' started by =?Utf-8?B?bXVzb3NkZXY=?=, Jan 18, 2006.

  1. Hi guys

    How do I get the new TreeView (asp2.0) to load something in an Iframe? I've
    setup a NaviagateUrl and set the Target property to the name of the Iframe,
    but it still tries to load a new window?!

    Cheers


    Dan
    =?Utf-8?B?bXVzb3NkZXY=?=, Jan 18, 2006
    #1
    1. Advertising

  2. Hi Dan,

    Welcome.
    As for the TreeView link's opened place, we just need to specify the target
    frame(or iframe)'s "name" in the "Target" property of the TreeViewNode. e.g:

    Here is a test page I used on my side which works well, you can have a try
    to see whether it also works on your side:

    ====================

    <form id="form1" runat="server">
    <div>
    <table border="0" cellpadding="0" cellspacing="0" style="width:
    100%; height: 100%">
    <tr>
    <td style="width: 200px" valign="top">
    <a href="conPage1.aspx" target="ifContent" >Test
    Link...</a>
    <asp:TreeView ID="TreeView1" runat="server"
    Width="100%" Height="100%">
    <Nodes>
    <asp:TreeNode Text="Root1" Value="Root1">
    <asp:TreeNode
    NavigateUrl="http://www.asp.net" Target="ifContent" Text="Sub11"
    Value="Sub11">
    </asp:TreeNode>
    <asp:TreeNode
    NavigateUrl="http://www.theserverside.net" Target="ifContent" Text="Sub12"
    Value="Sub12"></asp:TreeNode>
    </asp:TreeNode>
    <asp:TreeNode Text="Root2" Value="Root2">
    <asp:TreeNode
    NavigateUrl="http://msdn.microsoft.com" Target="_new" Text="Sub21"
    Value="Sub21"></asp:TreeNode>
    <asp:TreeNode Text="Sub22"
    Value="Sub22"></asp:TreeNode>
    </asp:TreeNode>
    <asp:TreeNode Text="Root3" Value="Root3">
    <asp:TreeNode Text="Sub31"
    Value="Sub31"></asp:TreeNode>
    <asp:TreeNode Text="Sub32"
    Value="Sub32"></asp:TreeNode>
    </asp:TreeNode>
    </Nodes>
    </asp:TreeView>
    </td>
    <td valign="top" width="600" >
    <iframe name="ifContent" src="default.aspx" width="100%"
    height="500"
    scrolling="no"></iframe>
    </td>
    </tr>
    </table>


    </div>
    </form>
    =================

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: TreeView
    | thread-index: AcYb/8zY1FZgHeddQTWUG3JZjeDREw==
    | X-WBNR-Posting-Host: 172.203.227.195
    | From: "=?Utf-8?B?bXVzb3NkZXY=?=" <>
    | Subject: Asp:TreeView
    | Date: Tue, 17 Jan 2006 23:21:29 -0800
    | Lines: 10
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:371643
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Hi guys
    |
    | How do I get the new TreeView (asp2.0) to load something in an Iframe?
    I've
    | setup a NaviagateUrl and set the Target property to the name of the
    Iframe,
    | but it still tries to load a new window?!
    |
    | Cheers
    |
    |
    | Dan
    |
    Steven Cheng[MSFT], Jan 18, 2006
    #2
    1. Advertising

  3. Hi Steven

    Yep thanks, that worked!

    Surely using "id" would have been better?! Seems like everything else is
    moving toward a solely id model..?

    Cheers


    Dan

    "Steven Cheng[MSFT]" wrote:

    > Hi Dan,
    >
    > Welcome.
    > As for the TreeView link's opened place, we just need to specify the target
    > frame(or iframe)'s "name" in the "Target" property of the TreeViewNode. e.g:
    >
    > Here is a test page I used on my side which works well, you can have a try
    > to see whether it also works on your side:
    >
    > ====================
    >
    > <form id="form1" runat="server">
    > <div>
    > <table border="0" cellpadding="0" cellspacing="0" style="width:
    > 100%; height: 100%">
    > <tr>
    > <td style="width: 200px" valign="top">
    > <a href="conPage1.aspx" target="ifContent" >Test
    > Link...</a>
    > <asp:TreeView ID="TreeView1" runat="server"
    > Width="100%" Height="100%">
    > <Nodes>
    > <asp:TreeNode Text="Root1" Value="Root1">
    > <asp:TreeNode
    > NavigateUrl="http://www.asp.net" Target="ifContent" Text="Sub11"
    > Value="Sub11">
    > </asp:TreeNode>
    > <asp:TreeNode
    > NavigateUrl="http://www.theserverside.net" Target="ifContent" Text="Sub12"
    > Value="Sub12"></asp:TreeNode>
    > </asp:TreeNode>
    > <asp:TreeNode Text="Root2" Value="Root2">
    > <asp:TreeNode
    > NavigateUrl="http://msdn.microsoft.com" Target="_new" Text="Sub21"
    > Value="Sub21"></asp:TreeNode>
    > <asp:TreeNode Text="Sub22"
    > Value="Sub22"></asp:TreeNode>
    > </asp:TreeNode>
    > <asp:TreeNode Text="Root3" Value="Root3">
    > <asp:TreeNode Text="Sub31"
    > Value="Sub31"></asp:TreeNode>
    > <asp:TreeNode Text="Sub32"
    > Value="Sub32"></asp:TreeNode>
    > </asp:TreeNode>
    > </Nodes>
    > </asp:TreeView>
    > </td>
    > <td valign="top" width="600" >
    > <iframe name="ifContent" src="default.aspx" width="100%"
    > height="500"
    > scrolling="no"></iframe>
    > </td>
    > </tr>
    > </table>
    >
    >
    > </div>
    > </form>
    > =================
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    > --------------------
    > | Thread-Topic: TreeView
    > | thread-index: AcYb/8zY1FZgHeddQTWUG3JZjeDREw==
    > | X-WBNR-Posting-Host: 172.203.227.195
    > | From: "=?Utf-8?B?bXVzb3NkZXY=?=" <>
    > | Subject: Asp:TreeView
    > | Date: Tue, 17 Jan 2006 23:21:29 -0800
    > | Lines: 10
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:371643
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | Hi guys
    > |
    > | How do I get the new TreeView (asp2.0) to load something in an Iframe?
    > I've
    > | setup a NaviagateUrl and set the Target property to the name of the
    > Iframe,
    > | but it still tries to load a new window?!
    > |
    > | Cheers
    > |
    > |
    > | Dan
    > |
    >
    >
    =?Utf-8?B?bXVzb3NkZXY=?=, Jan 18, 2006
    #3
  4. Thanks for your response Dan,

    We can add "id" attribute or html element, but for the hyperlink's
    "Target", it should point to a frame's "name" attribute value...
    "Id" is useful when we want to use script code to reference a html element,
    e.g:

    var txt = document.getElementById("txtInput");

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: Asp:TreeView
    | thread-index: AcYcJZj0wDJqHKpwSRapxDa5LvumIw==
    | X-WBNR-Posting-Host: 172.203.227.195
    | From: "=?Utf-8?B?bXVzb3NkZXY=?=" <>
    | References: <>
    <>
    | Subject: RE: Asp:TreeView
    | Date: Wed, 18 Jan 2006 03:52:03 -0800
    | Lines: 124
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:371681
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Hi Steven
    |
    | Yep thanks, that worked!
    |
    | Surely using "id" would have been better?! Seems like everything else is
    | moving toward a solely id model..?
    |
    | Cheers
    |
    |
    | Dan
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hi Dan,
    | >
    | > Welcome.
    | > As for the TreeView link's opened place, we just need to specify the
    target
    | > frame(or iframe)'s "name" in the "Target" property of the TreeViewNode.
    e.g:
    | >
    | > Here is a test page I used on my side which works well, you can have a
    try
    | > to see whether it also works on your side:
    | >
    | > ====================
    | >
    | > <form id="form1" runat="server">
    | > <div>
    | > <table border="0" cellpadding="0" cellspacing="0" style="width:
    | > 100%; height: 100%">
    | > <tr>
    | > <td style="width: 200px" valign="top">
    | > <a href="conPage1.aspx" target="ifContent" >Test
    | > Link...</a>
    | > <asp:TreeView ID="TreeView1" runat="server"
    | > Width="100%" Height="100%">
    | > <Nodes>
    | > <asp:TreeNode Text="Root1" Value="Root1">
    | > <asp:TreeNode
    | > NavigateUrl="http://www.asp.net" Target="ifContent" Text="Sub11"
    | > Value="Sub11">
    | > </asp:TreeNode>
    | > <asp:TreeNode
    | > NavigateUrl="http://www.theserverside.net" Target="ifContent"
    Text="Sub12"
    | > Value="Sub12"></asp:TreeNode>
    | > </asp:TreeNode>
    | > <asp:TreeNode Text="Root2" Value="Root2">
    | > <asp:TreeNode
    | > NavigateUrl="http://msdn.microsoft.com" Target="_new" Text="Sub21"
    | > Value="Sub21"></asp:TreeNode>
    | > <asp:TreeNode Text="Sub22"
    | > Value="Sub22"></asp:TreeNode>
    | > </asp:TreeNode>
    | > <asp:TreeNode Text="Root3" Value="Root3">
    | > <asp:TreeNode Text="Sub31"
    | > Value="Sub31"></asp:TreeNode>
    | > <asp:TreeNode Text="Sub32"
    | > Value="Sub32"></asp:TreeNode>
    | > </asp:TreeNode>
    | > </Nodes>
    | > </asp:TreeView>
    | > </td>
    | > <td valign="top" width="600" >
    | > <iframe name="ifContent" src="default.aspx"
    width="100%"
    | > height="500"
    | > scrolling="no"></iframe>
    | > </td>
    | > </tr>
    | > </table>
    | >
    | >
    | > </div>
    | > </form>
    | > =================
    | >
    | > Regards,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | > --------------------
    | > | Thread-Topic: TreeView
    | > | thread-index: AcYb/8zY1FZgHeddQTWUG3JZjeDREw==
    | > | X-WBNR-Posting-Host: 172.203.227.195
    | > | From: "=?Utf-8?B?bXVzb3NkZXY=?=" <>
    | > | Subject: Asp:TreeView
    | > | Date: Tue, 17 Jan 2006 23:21:29 -0800
    | > | Lines: 10
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA02.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:371643
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > |
    | > | Hi guys
    | > |
    | > | How do I get the new TreeView (asp2.0) to load something in an
    Iframe?
    | > I've
    | > | setup a NaviagateUrl and set the Target property to the name of the
    | > Iframe,
    | > | but it still tries to load a new window?!
    | > |
    | > | Cheers
    | > |
    | > |
    | > | Dan
    | > |
    | >
    | >
    |
    Steven Cheng[MSFT], Jan 19, 2006
    #4
    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. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,460
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  2. abargaddon
    Replies:
    0
    Views:
    1,054
    abargaddon
    Jan 17, 2008
  3. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    464
    Steve Drake
    Oct 15, 2003
  4. Ionutz
    Replies:
    2
    Views:
    529
    Ionutz
    Oct 23, 2005
  5. stepkurt

    Microsoft Treeview vs System Treeview

    stepkurt, Aug 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    379
    Teemu Keiski
    Sep 2, 2007
Loading...

Share This Page