• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 634
  • Last Modified:

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

0
Gaiala
Asked:
Gaiala
1 Solution
 
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
 
GaialaAuthor Commented:
thank you!
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now