V
VB Programmer
I have 2 webforms. When I print out the page.Controls(1).tostring variable
one says "HtmlForm", the other "HtmlGenericControl". How can I change the
first one to "HtmlForm"?
? page.Controls(1).tostring
"System.Web.UI.HtmlControls.HtmlForm"
? page.Controls(1).tostring
"System.Web.UI.HtmlControls.HtmlGenericControl"
The reason why is that I am trying to change the forms background color
based on a value in my web.config file.
This is how I am doing it:
' set background color based on web.config setting
Dim Body As New HtmlGenericControl
Body = CType(Page.Controls(1), HtmlGenericControl)
Body.Attributes("bgcolor") =
ConfigurationSettings.AppSettings("BackgroundColor")
one says "HtmlForm", the other "HtmlGenericControl". How can I change the
first one to "HtmlForm"?
? page.Controls(1).tostring
"System.Web.UI.HtmlControls.HtmlForm"
? page.Controls(1).tostring
"System.Web.UI.HtmlControls.HtmlGenericControl"
The reason why is that I am trying to change the forms background color
based on a value in my web.config file.
This is how I am doing it:
' set background color based on web.config setting
Dim Body As New HtmlGenericControl
Body = CType(Page.Controls(1), HtmlGenericControl)
Body.Attributes("bgcolor") =
ConfigurationSettings.AppSettings("BackgroundColor")