I have a outer skin page ( say mainpage.aspx) which contains controls like label and textbox.
I am useing another page (say content.aspx) to display actual content of the page.
How do i access the outer skin page controls (example mainpage.aspx label control) in content.aspx ?
doing something like this but throwing error
mainpage obj= new mainpager()
Label mainlbl = (Label)obj.Form.FindControl("prodlbl");
Loading
Nilanka DharmadasaPosted Jan 14, 2010, 11:30 PM
First you write a constructor and public properties to access each control in main page like below.
public Label mainlbl;
public Button mainbutton;
public mainpage()
{
mainlbl = (Label)this.FindControl("prodlbl");
mainbutton = (Button)this.FindControl("Button1");
}
Then you can access them in other pages like this.
mainpage obj= new mainpager()
Label mainlbl = obj.mainlbl;
Button mainb = obj.mainbutton;
Please tick 'Do you like this answer check box', if my answer helps you. It helps me.
zoren baybayanPosted Jan 14, 2010, 8:10 PM
in content.aspx try to code this in load event
dim hold as String
hold=mainpage.textbox.text
hope it helps
for more help you can mail me at [email protected]
zoren baybayanPosted Jan 14, 2010, 8:10 PM
in content.aspx try to code this in load event
dim hold as String
hold=mainpage.textbox.text
hope it helps