dynamically added textbox RRS feed

  • Question

  • how i can get dynamically added text box value
    Wednesday, May 15, 2013 12:42 PM


All replies

  • Hi, What you mean dynamically added? Through code? then you will have the object reference, which you can use, like TextBox txtBox = new TextBox(); then txtBox.Text will get you the text.

    Please Mark as Answered If this answers your question Or UnMark as Answered if it did not.
    Happy to Help :)
    My Site

    Wednesday, May 15, 2013 1:00 PM
  • You can use FrameworkElement.FindName to find the TextBox and then you can get the Text as shown if following code

    TextBox txt = this.FindName("Control Name") as TextBox;
    if (txt != null)
         MessageBox.Show("TextBox value is" + txt.Text);

    Or you can refer following link


    Gaurav Khanna | Microsoft VB.NET MVP | Microsoft Community Contributor

    • Edited by Khanna Gaurav Wednesday, May 15, 2013 1:28 PM
    • Proposed as answer by Lisa Zhu Thursday, May 16, 2013 11:50 AM
    • Marked as answer by Lisa Zhu Wednesday, May 22, 2013 12:36 PM
    Wednesday, May 15, 2013 1:26 PM