Using frames with ASP.NET 2.0 and TreeView

C

celoftis

Using VS2005, VB code behind,

BACKGROUND
I'm trying to set up a page with a TreeView of links on the left hand
side of my page - when clicked I want the links to open in the
remaining portion of the page. The best and easiest way I've found todo
this is with using frames (any suggestions on other ways todo this I'd
love to hear about it).

PROBLEM
I'm having trouble getting all links in my tree view to populate my
targeted frame.
Specifically, when I click on the "mail.google.com" link, it opens in
"_self", not the "showframe".

Is there something wrong with my code (see below)? Is there something
in the Google page that makes it not open in frames?

Thanks for your attention to this...


Here's the sample code, 2 files, I am using:
***************************************************************************­*********mainFrame.aspx:***************************************************­*********************************

<%@ Page Language="VB" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title />
</head>
<frameset cols="15%, *">
<frame name="toc" src=Default.aspx />
<frame name="showframe" />
</frameset>
</html>


***************************************************************************­*********Default.aspx******************************************************­******************************

<%@ Page Language="VB" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode
Text="mail.google.com"
NavigateUrl="http://mail.google.com"
Target="showframe">
<asp:TreeNode
Text="http://espn.com"
NavigateUrl="http://espn.com"
Target="showframe">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode
Text="http://cnnsi.com"
NavigateUrl="http://cnnsi.com"
Target="showframe">
<asp:TreeNode
Text="http://drudgereport.com"
NavigateUrl="http://drudgereport.com"
Target="showframe">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top