Finding controls inside a details view
Posted on 2008-10-24
I am building a website using ASP.NET 2.0 and Visual Studio 2005.
I have a page (called default.aspx) which has a SqlDatasouce in it, a FormView, and a DetailsView inside of the FormView.
Inside the detailsview, there are two columns (both are templateitems). One contains a webusercontrol (called "mywebusercontrol") and one is a textbox (called "textbox1")
The webusercontrol needs to know about the textbox, because it uses the value of the textbox to do other processing. So I made a property in the webusercontrol called "TargetTextBox", of type "Textbox". Now I need to initialize that property when the page loads.
But in the Page_Load even for my default.aspx page, I can't see any of these controls I created. The intellisense doesn't show the WebUserControl or the Textbox. The only thing I can see is the FormView, but I can't see anything inside of it.
How do I initialize this TargetTextBox property of the WebUserControl1 object to be equal to a reference to the TextBox1 object?