This is a migrated thread and some comments may be shown as answers.

External content in NestedSplitter

2 Answers 76 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
HSLaw
Top achievements
Rank 1
HSLaw asked on 06 Feb 2009, 08:07 AM

Hi,
Below is my code trying to open google in the contenpane but it opens in new window instead.
what did I do wrong here?

<div id="ParentDivElement" style="height: 100%;">  
        <telerik:radsplitter id="MainSplitter" runat="server" height="100%" width="100%" 
            orientation="Horizontal" skin="Outlook">  
              
            <telerik:RadPane ID="TopPane" runat="server" Height="100" MinHeight="85" MaxHeight="150" 
                Scrolling="none">  
                <!-- Place the content of the pane here --> 
            </telerik:RadPane> 
              
            <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" /> 
              
            <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500">  
                  
                <telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Web20" LiveResize="true">  
                      
                    <telerik:RadPane ID="LeftPane" runat="server" Width="300" MinWidth="150" MaxWidth="400">  
                        <!-- Place the content of the pane here --> 
                         <href="http://google.com" target="<%= contentPane.ClientID%>">  
                        Open google.com</a> 
                    </telerik:RadPane> 
                      
                    <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" /> 
                      
                    <telerik:RadPane ID="ContentPane" runat="server">  
                        <!-- Place the content of the pane here --> 
                    </telerik:RadPane> 
                      
                </telerik:RadSplitter> 
                  
            </telerik:RadPane> 
        </telerik:radsplitter> 
    </div> 

2 Answers, 1 is accepted

Sort by
0
HSLaw
Top achievements
Rank 1
answered on 06 Feb 2009, 09:58 AM
It is working after I add a default contentURL. But when I use treeview, it is not working. (Text="<a href='http://www.yahoo.com' target='<%=ContentPane.clientid %>'>Root RadTreeNode3</a>">)


Here is my code:

<div id="ParentDivElement" style="height: 100%;">  
        <telerik:radsplitter id="MainSplitter" runat="server" height="100%" width="100%"   
            orientation="Horizontal" LiveResize="true" Skin="Web20" > 
              
            <telerik:RadPane  ID="TopPane" runat="server" Height="100" MinHeight="85" MaxHeight="150" 
                Scrolling="none">  
                <!-- Place the content of the pane here --> 
            </telerik:RadPane> 
              
            <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" /> 
              
            <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500">  
                  
                <telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Web20" LiveResize="true">  
                      
                    <telerik:RadPane ID="LeftPane" runat="server" Width="300" MinWidth="150" MaxWidth="400">  
                        <!-- Place the content of the pane here --> 
                        <href='http://www.yahoo.com' target='<%=ContentPane.clientid %>'>Root RadTreeNode3</a> 
                         <telerik:RadTreeView  
   ID="RadTreeView1" 
   runat="server" 
   LoadingStatusPosition="BeforeNodeText" 
   Width="200px">  
  <Nodes> 
      <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Root RadTreeNode1 Root RadTreeNode1 Root RadTreeNode1 Root RadTreeNode1" style="white-space:normal">  
      </telerik:RadTreeNode> 
      <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Root RadTreeNode2">  
      </telerik:RadTreeNode> 
      <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="<a href='http://www.yahoo.com' target='<%=ContentPane.clientid %>'>Root RadTreeNode3</a>">  
      </telerik:RadTreeNode> 
  </Nodes> 
  <CollapseAnimation Duration="100" Type="OutQuint" /> 
  <ExpandAnimation Duration="100" Type="OutQuart" /> 
</telerik:RadTreeView>   
                    </telerik:RadPane> 
                      
                    <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" /> 
                      
                    <telerik:RadPane ID="ContentPane" contenturl="http://blogs.telerik.com" runat="server">  
                        <!-- Place the content of the pane here --> 
                    </telerik:RadPane> 
                      
                </telerik:RadSplitter> 
                  
            </telerik:RadPane> 
        </telerik:radsplitter> 
    </div> 
0
Tsvetie
Telerik team
answered on 09 Feb 2009, 09:20 AM
Hi Paladin,
Yes, you need to initially set the ContentUrl of the RadPane, so that it creates an IFRAME element, in which the links open.

As for the problem with the RadTreeVuew - first of all, please do not use:
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="<a href='http://www.yahoo.com' target='<%=ContentPane.clientid %>'>Root RadTreeNode3</a>">   
</telerik:RadTreeNode> 

The correct way is to use the NavigateUrl property of the RadTreeNode:
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" NavigateUrl="http://www.yahoo.com"  
    Target="<%= ContentPane.ClientID %>" Text="Root RadTreeNode3"
</telerik:RadTreeNode> 

When you user server controls (e.g. you have runat="server"), in most cases the expression between the server tags is not evaluated. Have a look at the HTML that is rendered:
<li class="rtLI rtLast"
    <div class="rtBot"
        <span class="rtSp"></span> 
        <class="rtIn" href="http://www.yahoo.com" target="<%= ContentPane.ClientID %>">Root RadTreeNode3</a> 
    </div> 
</li> 

That is why, you have to set the Target of the RadTreeNode on the server. For example:
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" NavigateUrl="http://www.yahoo.com"  
    Text="Root RadTreeNode3"
</telerik:RadTreeNode> 

code-behind:
protected void Page_Load(object sender, EventArgs e) 
    RadTreeNode node = RadTreeView1.FindNodeByText("Root RadTreeNode3"); 
    node.Target = ContentPane.ClientID; 

Best wishes,
Tsvetie
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Splitter
Asked by
HSLaw
Top achievements
Rank 1
Answers by
HSLaw
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or