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"
where am i going wrong?
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 subWhere are you invoking SetBackgroundColour method? And what is the
value of the paramter that you are passing?
Page.Controls?
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------
i have a SetMode Method which runs on the page load. For an Add, Edit or
ViewMode
within SetMode i call EnableFields, followed by SetBackGroundColour
and yes the parameter being passed in is Page.Controls
Cheers,
Craig
"MasterGaurav" <gaurav.vaish@.gmail.com> wrote in message
news:1109086796.498624.67000@.l41g2000cwc.googlegro ups.com...
> Where are you invoking SetBackgroundColour method? And what is the
> value of the paramter that you are passing?
> Page.Controls?
>
> --
> Cheers,
> Gaurav Vaish
> http://www.mastergaurav.org
> http://mastergaurav.blogspot.com
> ----------
Here... try passing "this.Controls".
void Page_Load(...)
{
SetBackgroundColour(Controls);
}
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------
nope still no joy!
"MasterGaurav" <gaurav.vaish@.gmail.com> wrote in message
news:1109087723.659776.246110@.c13g2000cwb.googlegr oups.com...
> Here... try passing "this.Controls".
> void Page_Load(...)
> {
> SetBackgroundColour(Controls);
> }
>
> --
> Cheers,
> Gaurav Vaish
> http://www.mastergaurav.org
> http://mastergaurav.blogspot.com
> ----------
What version of ASP.Net are you using?
AFAIK, this is how it is supposed to work... in 1.1 and this is how I
have been working with in IBuySpy.
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------
yep we are using 1.1
the page uses frames, would that cause problems?
"MasterGaurav" <gaurav.vaish@.gmail.com> wrote in message
news:1109172866.091650.248920@.g14g2000cwa.googlegr oups.com...
> What version of ASP.Net are you using?
> AFAIK, this is how it is supposed to work... in 1.1 and this is how I
> have been working with in IBuySpy.
>
> --
> Cheers,
> Gaurav Vaish
> http://www.mastergaurav.org
> http://mastergaurav.blogspot.com
> ----------
0 comments:
Post a Comment