Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Access a Textbox Value from Page to UserControl [closed]

Tags:

c#

asp.net

I am having an aspx page(example.aspx) with text box control(txtid) and on the same page i am creating a user control(access.ascx) with an image button(click.png). i have to retrieve the text box(txtid) into the user control. how can i retrieve the value of text box control(txtid) in to the usercontrol page(access.ascx)?

like image 974
Vinaykrishnan Avatar asked Dec 02 '25 10:12

Vinaykrishnan


1 Answers

try something like:

TextBox txt= (TextBox)this.Parent.FindControl("txtid");

that would go in your usercontrol. this.Parent should get you a reference to the example.aspx page.

like image 93
Paritosh Avatar answered Dec 05 '25 00:12

Paritosh