How to access values of constituent controls in a User Control

D

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
 
A

Anil Paranganat

Create a public Text property... and use this property to get and set the
textbox text.

Anil Paranganat
 
D

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top