Click here to Skip to main content
15,887,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a tree view control in my asp.net web application. when each node is selected, it will show a web page inside the i-frame.My problem is the
SelectedNodeStyle
property does not work with the tree nodes whose target is specified as iframe. Please suggest me a solution for this.My code is given below.Here I have specified the SelectedNodeStyle as bold. When I run the website, all the nodes with out target property works fine;when I click on them,it becomes bold. But the display style of tree nodes with target as iframe doesn't change when I click on them.

What I have tried:

<div class="menutree">
<asp:TreeView ID="Treeview1"  runat="server" Target="frame1"  BorderColor="#00CCFF" Font-Bold="False" Font-Italic="False" Font-Size="Large" style="text-align:left" margin-top="200px"  LineImagesFolder="~/TreeLineImages" ImageSet="Arrows">

                           <Nodes>
                              <asp:TreeNode Text="State" Value="Kerala" Expanded="True" >
                                 <asp:TreeNode Text="Kerala" Value="Kerala" Expanded="False">
                                    <asp:TreeNode Text="Kerala Boundary" Value="KeralaBoundary" NavigateUrl="~/Output.aspx"   Target="frame1"></asp:TreeNode>
                                    <asp:TreeNode Expanded="False" Text="Administrative Division" Value="KeralaAdministrative ">
                                       <asp:TreeNode Text="Rural" Value="Rural" Expanded="False">
                                          <asp:TreeNode Text="Block Panchayat" Value="BlockPanchayat" NavigateUrl="~/WebForm3.aspx" Target="frame1" ></asp:TreeNode>
                                          <asp:TreeNode Text="Grama Panchayat" Value="GramaPanchayat" ></asp:TreeNode>
                                       </asp:TreeNode>
                                       <asp:TreeNode Text="Urban" Value="Urban/" Expanded="False">
                                          <asp:TreeNode Text="Municipality" Value="Municipality" ></asp:TreeNode>
                                          <asp:TreeNode Text="Corporation" Value="Corporation" ></asp:TreeNode>
                                       </asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Expanded="False" Text="Revenue Division" Value="KeralaRevenue">
                                       <asp:TreeNode Text="Rural Area" Value="Rural" Expanded="False">
                                          <asp:TreeNode Text="Taluk" Value="Taluk" ></asp:TreeNode>
                                          <asp:TreeNode Text="Village" Value="Village" ></asp:TreeNode>
                                       </asp:TreeNode>
                                       <asp:TreeNode Text="Urban Area" Value="Urban" Expanded="False">
                                          <asp:TreeNode Text="Municipality" Value="Municipality" ></asp:TreeNode>
                                          <asp:TreeNode Text="Corporation" Value="Corporation" ></asp:TreeNode>
                                       </asp:TreeNode>
                                    </asp:TreeNode>
                                 </asp:TreeNode>
                               </asp:TreeNode>
                           </Nodes>
                           <NodeStyle  Font-Names="Verdana" Font-Size="Small" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
                           <HoverNodeStyle  Font-Underline="True" ForeColor="#5555DD"/>
                           <ParentNodeStyle Font-Bold="False" />
                           <SelectedNodeStyle Font-Bold="true" />
</asp:TreeView>
 </div>
<asp:Panel ID="Panel1" runat="server">
                        <div class="iframeclass">
                            <iframe width="957" height="600"  name="frame1"  id="frame1" ></iframe>
                        </div>
</asp:Panel>
Posted
Updated 19-Jun-18 18:18pm
v3
Comments
F-ES Sitecore 19-Jun-18 4:36am    
Is the page in the iframe on the same site as the parent page?
Jo S 20-Jun-18 0:08am    
Yes, it is in the same site.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900