Home All Groups Group Topic Archive Search About

How to access values of constituent controls in a User Control

Author
21 Jul 2005 8:22 PM
dwok
Hi All,

  I am building what I thought was a very simple user control in
ASP.NET. The control is just a standard asp.net calendar control and a
text box control. When the user selects a date within the calendar
control, the text box is updated with the selected date.

  My problem is how do I access the text within the text box? It is no
longer a seperate text box control but rather it is part of a User
Control. Any thoughts?

Thank you.

- Drek

Author
21 Jul 2005 8:53 PM
Anil Paranganat
Create a public Text property...  and use this property to get and set the
textbox text.

Anil Paranganat


Show quoteHide quote
"dwok" <de***@wubbafish.net> wrote in message
news:1121977364.710815.181090@z14g2000cwz.googlegroups.com...
> Hi All,
>
>   I am building what I thought was a very simple user control in
> ASP.NET. The control is just a standard asp.net calendar control and a
> text box control. When the user selects a date within the calendar
> control, the text box is updated with the selected date.
>
>   My problem is how do I access the text within the text box? It is no
> longer a seperate text box control but rather it is part of a User
> Control. Any thoughts?
>
> Thank you.
>
> - Drek
>
Author
22 Jul 2005 12:54 PM
dwok
That worked! Thank you for the reply.

I created a ReadOnly Property that returned to me the value of the text
control.

Public ReadOnly Property MyTextBoxValue() as string
  return theTextbox.value
End Property