Results 1 to 2 of 2

Thread: Enable all textboxs on an ascx

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    Left past the postbox
    Posts
    30

    Enable all textboxs on an ascx

    hi,

    How do i enable all textboxs on an ascx??

    Thanks

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    Left past the postbox
    Posts
    30

    [RESOLVED]

    Here is how to do it for people who had the same problems

    Code:
    
     Private Sub Enabletextboxs()
    
            ' Find control on page.
            ' I used txtStart to get the parent because its on an ascx
            Dim mycontrol1 As Control = FindControl("txtStart") 
    
            Dim mycontrol2 As Control = myControl1.Parent
    
    
            For Each mycontrol1 In mycontrol2.Controls
    
    
                '"System.Web.UI.WebControls.ListBox"
                Dim tmp As String = mycontrol1.GetType().FullName
    
    
                If tmp = "System.Web.UI.WebControls.TextBox" Then
    
                   
                        CType(mycontrol1, TextBox).Enabled = True
    
    
                End If
    
    
    
            Next
    
    
         
    
        End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width