简体   繁体   中英

Access control on other page in asp.net

如何从asp.net中的其他aspx页访问其他aspx页中的控件

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM