Usercontrol enable property

G

greatdane

I have a usercontrol with a textbox.
I displayed the control programmatically on my .aspx

How could I manipulate the 'enable property' and/or bordercolor of the ucl
textbox from my .aspx page?
 
G

greatdane

This helped me... Thanks
In addition I am trying to create on my page an array of 4 strings
containing the name of 4 textboxes from my control.
Dim a(4) as string
a(0) = "txtCrownofroad"
a(1) = "txtcntyfld"
a(2) = "txtreviewzone"
a(3) = "txtreviewbfe"
Dim x As Integer

For x = 0 To a.Length
CType(ctlFReview_entry.FindControl(a(x)), TextBox).ReadOnly =
False
CType(ctlFReview_entry.FindControl(a(x)), TextBox).BorderColor =
Color.SteelBlue
Next
I am getting an error because it is not reading '.FindControl(a(x))...
 
S

Steve C. Orr [MVP, MCSD]

What is the error you are getting?


greatdane said:
This helped me... Thanks
In addition I am trying to create on my page an array of 4 strings
containing the name of 4 textboxes from my control.
Dim a(4) as string
a(0) = "txtCrownofroad"
a(1) = "txtcntyfld"
a(2) = "txtreviewzone"
a(3) = "txtreviewbfe"
Dim x As Integer

For x = 0 To a.Length
CType(ctlFReview_entry.FindControl(a(x)), TextBox).ReadOnly =
False
CType(ctlFReview_entry.FindControl(a(x)), TextBox).BorderColor
=
Color.SteelBlue
Next
I am getting an error because it is not reading '.FindControl(a(x))...
 
G

greatdane

I did not write the error down; however, reading a little further from the
article the you referenced before, I decided to implented the code as follow:
It is a better approach. Thanks for your help!!
For Each Panel2_Control As Control In Panel2.Controls(0).Controls
If TypeOf Panel2_Control Is TextBox Then
CType(Panel2_Control, TextBox).ReadOnly = False
CType(Panel2_Control, TextBox).BorderColor = Color.SteelBlue
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top