Problem with ASPX page and ascx user control passing values 
1. Create an ascx control 
2. Add attributes to ascx 
3. Drag the control into the ASPX 
4. Accessing properties by control ID in the code in ASPX 
such as: <uc3:left_repassword id= "Left_repassword1" runat= "Server"/> 
Left_repassword1.highlight = value; 
Also applies to master page access ascx 
 
Asp. NET Access Master page (MasterPage) controls, properties, methods, and methods of calling content pages in master pages 
Summarizes the ways in which ASP.net accesses master page (Master) controls, properties, methods, and call content pages (aspx) in master pages for your reference: 
 
First, the master page must be strongly typed through the Mastertye directive in the content page, that is, add the following directive to the settings of the content page dock 
<%@ MasterType virtualpath= "~/master/menuelement.master"%> 
Where virtualpath sets the master page URL address. 
 
1. Get the master page control reference. 
Sample code 
 
 
  
  Copy Code code as follows: 
 
 
  
 
  
  
<summary> 
  
Get a reference to a TreeView control in a master page 
  
</summary> 
  
Public TreeView Elementstructuretree 
  
{ 
  
Get 
  
{ 
  
return tvelementstructure; 
  
} 
  
Set 
  
{ 
  
Tvelementstructure = value; 
  
} 
  
} 
  
 
 
 
  
As shown in the code above, define a public property elementstructuretree in the master page that references the Tvelementstructure control in the master page, and then In the content page, you can refer to the Tvelementstructure control in the master page through public property master (a property of the core object page) as follows: 
TreeView TV = Master.elementstructuretree; 
2. Access the master Page properties. 
There are generally three types of properties in a master page: value type, class type, control type, and the "Get Master Page Control reference" above actually accesses the control type property, and the other two types of properties can be accessed in the same way. 
3. Invoke the master page method. 
The public methods defined in the master page can be called directly from Master. 
4. The method that invokes the content page in the master page. 
To define a delegate in a master page: 
public delegate void Elementselectedchangehandler (); 
Instantiate a delegate (another property) in a master page: 
Public Elementselectedchangehandler Elementselectedchange {private get; set;} 
Call the delegate where you want it in the master page: 
 
 
  
  Copy Code code as follows: 
 
 
  
 
  
  
if (Elementselectedchange!= null) 
  
{ 
  
Elementselectedchange (); 
  
} 
  
 
 
 
  
Specify a method in the content page that matches the delegate signature: 
Master.elementselectedchange = this. Elementselectedchange; 
The AutoEventWireup property of the 5.Master page must be set to "true" to automatically trigger all events for the control on the master page.