Access control on other page in asp.net
How to access contro开发者_如何学Cl in other aspx page from other aspx page in asp.net
you can use findcontrol
Example to get the textbox text:
string controlValue =((TextBox)( Page.FindControl("uc").FindControl("TextBox1"))).Text;
Note: us is id of usercontrol
registered in the aspx page. TextBox1
is the textbox in the usercontrol
Button btn = ((Button)PreviousPage.FindControl("Button1"));
Button1.Text = btn.Text;
Use : PreviousPage
Note : PreviousPage property Gets the page that transferred control to the current page.
精彩评论