Home All Groups Group Topic Archive Search About
Author
11 May 2007 3:39 PM
Madison
Hello;

I'm working with treeveiw control for framework 2.0, the treeview have
parent, child and grandchild. if user click on grandchild, I want to display
informtion in the right frame in the same page as treeview familar to this
MSDN newsgroups. How do I handle this event? I try to use frame in page and
set target to that frame but the page open in the whole page.

Thanks.

Author
14 May 2007 6:41 AM
Steven Cheng[MSFT]
Hi Madison,

As for the displaying linked url(navigation page) in a specified
frame(within a frameset container page), you can use the following approach:

1. First , in your frameset page, you need to give a fixed name to each
frame(especially the one you want to display linked url/page in) e.g.

====frameset page==========
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  >
<frameset cols = "200,*">
  <frame src ="nav.aspx"  name="nav"/>
  <frame src ="content.aspx"  name="content"/>

</frameset>

</html>

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

2. In your navigation page(that contain the treeview or menu), set the
"Target" attribute(of treeview node) to the frame name of the target frame
window you want to display page in. e.g.

=====in nav.aspx=============
<body  style=" margin-left:0; margin-right:0; margin-top:0;
margin-bottom:0">
    <form id="form1" runat="server">
    <div  style="vertical-align:top">
        <asp:TreeView ID="TreeView1" runat="server">
            <Nodes>
                <asp:TreeNode Text="New Node" Value="New Node">
                    <asp:TreeNode Text="New Node" Value="New Node">
                        <asp:TreeNode Text="ASP.NET Site" Value="ASP.NET
Site"
                         NavigateUrl="http://www.asp.net" Target="content"
></asp:TreeNode>
                    </asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode Text="New Node" Value="New Node">
                    <asp:TreeNode Text="New Node" Value="New Node">
                        <asp:TreeNode Text="The ServerSide Site" Value="The
ServerSide Site"
                         NavigateUrl="http://www.theserverside.net"
Target="content" ></asp:TreeNode>
                    </asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode Text="New Node" Value="New Node">
                    <asp:TreeNode Text="New Node" Value="New Node">
                        <asp:TreeNode Text="New Node" Value="New
Node"></asp:TreeNode>
                    </asp:TreeNode>
                </asp:TreeNode>
            </Nodes>
        </asp:TreeView>

    </div>
    </form>
</body>
</html>
================================

http://www.w3schools.com/tags/tag_frame.asp

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



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.

Bookmark and Share

Post Thread options