DropDownList_selectedIndexChanged get content of a TextBox

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

GaialaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vb_jonasCommented:

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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GaialaAuthor Commented:
thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.