We help IT Professionals succeed at work.

DropDownList_selectedIndexChanged get content of a TextBox

Medium Priority
664 Views
Last Modified: 2010-04-21
Hello together,

on the following code I want to get the content of a TextBox if the DropDownList_selectedIndexChanged event fires.

Thanks in advice
Gaiala
Public Sub DropDownList_selectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim strSelMenu As String = CType(sender, DropDownList).Text
        Dim ddl1 As DropDownList = CType(sender, DropDownList)
        Dim row As GridViewRow = CType(ddl1.NamingContainer, GridViewRow)
        ' here I just get the information System.Web.UITextBox
        ' but I want the content of the textbox
        'Dim strCQUID As String = row.FindControl("txt01").ToString()
 
    End Sub

Open in new window

Comment
Watch Question

Commented:

Public Sub DropDownList_selectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim strSelMenu As String = CType(sender, DropDownList).Text
        Dim ddl1 As DropDownList = CType(sender, DropDownList)
        Dim row As GridViewRow = CType(ddl1.NamingContainer, GridViewRow)
Dim txt01 as TextBox
txt01=CType(row.FindControl("txt01"),TextBox)
Dim strCQUID As String = txt01.text
 
    End Sub

Open in new window

Author

Commented:
thank you!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.