How can we access a text box in a "sub" that has been created in another "sub" dynamically

Discussion in 'ASP .Net' started by loga123, May 20, 2006.

  1. loga123

    loga123 Guest

    Hi All,

    I am new to .net. I am creating a text box in a "button1" "click
    event" dynamically based on user input. Name of the text box and ID of
    the text box contro are set dynamically in the server side code.
    How can make this text box accessable in another "sub" or "button2"
    click event?
    Any help is greatly appreciated.'

    thanks
     
    loga123, May 20, 2006
    #1
    1. Advertisements

  2. If you know the ID, you can use Page.FindControl() to find it out and cast
    it using CType().

    Alternatively, if you just need the TextBox's value, you can just use
    Request.Form["The control ID"] to retrieve.

    "loga123" <>
    ???????:...
    > Hi All,
    >
    > I am new to .net. I am creating a text box in a "button1" "click
    > event" dynamically based on user input. Name of the text box and ID of
    > the text box contro are set dynamically in the server side code.
    > How can make this text box accessable in another "sub" or "button2"
    > click event?
    > Any help is greatly appreciated.'
    >
    > thanks
    >
     
    Lau Lei Cheong, May 20, 2006
    #2
    1. Advertisements

  3. loga123

    loga123 Guest

    Thank you, it helped me !!
     
    loga123, May 20, 2006
    #3
    1. Advertisements

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. Gnarlodious
    Replies:
    4
    Views:
    18,007
    elizas
    May 5, 2010
  2. jimjim
    Replies:
    12
    Views:
    2,213
    Ron Natalie
    Jun 3, 2005
  3. Bob
    Replies:
    3
    Views:
    1,613
  4. msimmons
    Replies:
    0
    Views:
    796
    msimmons
    Jul 16, 2009
  5. Khamal

    The web has been created succesfully.....

    Khamal, Oct 18, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    216
    Bron Davies
    Nov 15, 2005
  6. Replies:
    2
    Views:
    250
  7. Chi
    Replies:
    1
    Views:
    198
    kaeli
    Oct 17, 2003
  8. libsfan01
    Replies:
    2
    Views:
    242
    Hal Rosser
    Apr 14, 2006
Loading...