will the page having frames cause this to fail?

C

Craig G

i have the routine setup as below. the ctlCollection is populated with
Page.Controls. but it only ever brings back 3 controls even though there is
more than this on the page

the control types it returns are

1 x "System.Web.UI.ResourceBasedLiteralControl"
1 x "System.Web.UI.HtmlControls.HtmlForm"
1 x "System.Web.UI.LiteralControl"

if it is the frames that are causing the problem is there any other way
around it?

Cheers,
Craig


Private Sub SetBackgroundColour(ByVal ctlCollection As ControlCollection)

Dim ctl As Control

Try

For Each ctl In ctlCollection

If ctl.GetType.ToString = "Textbox" Then

If CType(ctl, TextBox).Enabled = False Then

CType(ctl, TextBox).BackColor = Color.Transparent

Else

CType(ctl, TextBox).BackColor = Color.LightGoldenrodYellow

End If

End If

If ctl.GetType.ToString = "DropDownList" Then

If CType(ctl, DropDownList).Enabled = False Then

CType(ctl, DropDownList).BackColor = Color.Transparent

Else

CType(ctl, DropDownList).BackColor = Color.LightGoldenrodYellow

End If

End If

Next

end sub
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top