How to access values of constituent controls in a User Control

Discussion in 'ASP .Net' started by dwok, Jul 21, 2005.

  1. dwok

    dwok Guest

    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
    dwok, Jul 21, 2005
    #1
    1. Advertising

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

    Anil Paranganat


    "dwok" <> wrote in message
    news:...
    > 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
    >
    Anil Paranganat, Jul 21, 2005
    #2
    1. Advertising

  3. dwok

    dwok Guest

    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
    dwok, Jul 22, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Reckoner
    Replies:
    17
    Views:
    491
    John O'Hagan
    Feb 9, 2009
  2. Jim-M

    Constituent Controls and Design Time

    Jim-M, Jun 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    127
    Jim-M
    Jun 27, 2004
  3. dwok
    Replies:
    2
    Views:
    129
  4. dwok
    Replies:
    2
    Views:
    120
  5. Alex Maghen

    Passing "Style" along to constituent controls

    Alex Maghen, May 30, 2006, in forum: ASP .Net Web Controls
    Replies:
    9
    Views:
    221
    Walter Wang [MSFT]
    Jun 1, 2006
Loading...

Share This Page