Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference Text Box in .cs file

Status
Not open for further replies.

cupcakesrule

Programmer
Feb 6, 2007
35
US
Hi i have a test webpage with a text box with the id:
"testtextbox"
I tried to reference this text box in my .cs file like this
testtextbox.Text = "test text"
except i can't get the solution to build. How do i communicate with this text box in my .cs file?
 
I found the solution i was just trying to reference a text box from my aspx page with its associated .cs file in the .cs file. I just needed to add this line right after the class declaration
Code:
protected System.Web.UI.WebControls.TextBox testtextbox;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top