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. Advertising

  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. Advertising

  3. loga123

    loga123 Guest

    Thank you, it helped me !!
     
    loga123, May 20, 2006
    #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.

Share This Page