开发者

Access control on other page in asp.net

开发者 https://www.devze.com 2023-01-04 09:20 出处:网络
How to access contro开发者_如何学Cl in other aspx page from other aspx page in asp.netyou can use findcontrol

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消