A
aleko
Hi,
I am writing a server control, and I need a MinWidth property. Since
the min-width CSS style is not (properly) supported by IE, I am using
an expression, like so:
if (HttpContext.Current.Request.Browser.Browser.Contains("IE"))
{
table.Style.Add("width", "expression(document.body.clientWidth < " +
MinWidth.Value + " ? \"" + MinWidth.ToString() + "\" : \"auto\")");
}
else
{
table.Style.Add("width", "100%");
table.Style.Add("min-width", MinWidth.ToString());
}
The problem is that the outputted style HTML-encodes the style value:
style="width:expression(document.body.clientWidth < 960 ? "
960px" : "auto""
Is there a way to prevent the style from being encoded?
Thanks,
Aleko
I am writing a server control, and I need a MinWidth property. Since
the min-width CSS style is not (properly) supported by IE, I am using
an expression, like so:
if (HttpContext.Current.Request.Browser.Browser.Contains("IE"))
{
table.Style.Add("width", "expression(document.body.clientWidth < " +
MinWidth.Value + " ? \"" + MinWidth.ToString() + "\" : \"auto\")");
}
else
{
table.Style.Add("width", "100%");
table.Style.Add("min-width", MinWidth.ToString());
}
The problem is that the outputted style HTML-encodes the style value:
style="width:expression(document.body.clientWidth < 960 ? "
960px" : "auto""
Is there a way to prevent the style from being encoded?
Thanks,
Aleko