Thank John,
Here is what I would "think" would work:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
MyMainPageLabel.Text = "This is the first time viewing the page"
Else
MyMainPageLabel.Text = "The textbox value in the control is: " &
Mycontrol1.MyControlTextBox.Text
End If
End Sub
Based on a control called:
<uc1:mycontrol id="Mycontrol1" runat="server"></uc1:mycontrol>
Which in this user control, has a textbox:
<asp:TextBox id="MyControlTextBox" runat="server">Somevalue</asp:TextBox>
I have also tried refering to it as:
mycontrol.MyControlTextBox.Text
But I get a message saying it is inaccessible because it is "protected".
Thanks for the help!
Mike
"John Saunders" <john.saunders at surfcontrol.com> wrote in message
news:%...
> "Mike Hnatt" <> wrote in message
> news:...
> > Thanks Webdiyer,
> > But can anyone give me a hint as to what I need to do in order to do
this?
>
> Mike, what part didn't you understand?
> --
> John
>
> > "Webdiyer" <> wrote in message
> > news:...
> > > Make it a public property and you can refer to it from within
container
> > page
> > > by using this property.Hope it helps,thanks!
> > >
> > > "Mike Hnatt" <> 写入邮件
> > > news:...
> > > > How can I refer to MyTextBox.Text which is located in mycontrol.ascx
> > from
> > > > within mymainpage.aspx? (i.e, mycontrol.ascx is a User Control
> located
> > on
> > > > mymainpage.aspx).
> > > >
> > > > Thanks!
> > > > Mike
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|