I will try to sharp my question,
I developed a web control and I want to set the color of my container page, depending on one of the web control properties. I guess there are 2 options:
1. The easy and ugly way writing JavaScript Block from the server side :
<script language=?javaScript? For=?window? Event=?onload?>
document.bgColor = ?black?;
</script>
2. the nice way is to set the container page Body tag to runat=server and to set the BodyTag.Attributes.Add("bgcolor","black");
as you suggested.
My question refer to option number 2. will trying to access the BodyTag from the PreRender function in my control I?m having difficulties to find it in the Page hierarchy
My Code:
System.Web.UI.HtmlControls.HtmlGenericControl BodyTag = this.Parent.FindControl(?BodyTag?)
the problem ,as you can see FindControl return System.Web.Ui.Control
but I need System.Web.UI.HtmlControl to be return.