1
Answer

how to acess master page controls in aspx page

Hi, i have a treeview and menu control in master page so that to every aspx page these two controls will be added, menu control and treeview contol contains the node elements ie names of aspx pages what i want is if i click on menu item1 it goes to one aspx page and the treeeview node1 should be expanded and if i click the menu item2 it should go to another aspx page and in that page treeviewnode2 should be expanded this iam getting problem, from menu item click i am navigating to the coressponding aspx page but tree view node are not expanded because they r loading from masterpage please solve it for me
Answers (1)
0
Lalit M

Lalit M

NA 6.7k 48k 15y
Show this code sample

  1. <%@ Master Language="VB" CodeFile="site.master.vb" Inherits="site" %>  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  3.   
  4. <html xmlns="http://www.w3.org/1999/xhtml" >  
  5. <head runat="server">  
  6.     <title>Untitled Page</title>  
  7. </head>  
  8. <body>  
  9.     <form id="form1" runat="server">  
  10.     <div>  
  11.         <asp:Label ID="Label1" runat="server" Text="Testing"></asp:Label>  
  12.         <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">  
  13.         </asp:contentplaceholder>  
  14.     </div>  
  15.     </form>  
  16. </body>  
  17. </html>  
and our Content Page would look like this:
  1. <%@ Page Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" CodeFile="Default1.aspx.vb" Inherits="Default1"  %>  
  2. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
  3.     <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>  
  4. </asp:Content> 
Also See this articles