Home All Groups Group Topic Archive Search About

Dynamically Creating A CSS Class

Author
26 Jun 2006 3:52 AM
Nathan Sokalski
I have a control that creates a CSS class which I want to put on the page.
Other people have told me that the best way to do this is using the
RegisterClientScriptBlock method, even though it is not a script. I have
done it using this method, but I am now writing my first control as a custom
control (one that is a *.vb file rather than a *.ascx file). My control
works fine, except the CSS from the RegisterClientScriptBlock is not showing
up in the browser. I think that the line of code with the
RegisterClientScriptBlock is getting called too late to show up in the
output (I call it during the Render method). Where would be the best place
to call this from? Thanks.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
26 Jun 2006 4:54 AM
Cor Ligthert [MVP]
Nathan,

I am not so sure, I thought that this one was performing earlier, although
on the MSDN page is written that it goes in the same time. Maybe you can try
it yourself.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterStartupScriptTopic.asp

I hope this helps,

Cor


Show quoteHide quote
"Nathan Sokalski" <njsokal***@hotmail.com> schreef in bericht
news:%23TTICQNmGHA.1912@TK2MSFTNGP02.phx.gbl...
>I have a control that creates a CSS class which I want to put on the page.
>Other people have told me that the best way to do this is using the
>RegisterClientScriptBlock method, even though it is not a script. I have
>done it using this method, but I am now writing my first control as a
>custom control (one that is a *.vb file rather than a *.ascx file). My
>control works fine, except the CSS from the RegisterClientScriptBlock is
>not showing up in the browser. I think that the line of code with the
>RegisterClientScriptBlock is getting called too late to show up in the
>output (I call it during the Render method). Where would be the best place
>to call this from? Thanks.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
>
Author
26 Jun 2006 7:29 AM
Vadivel Kumar
May be you can override OnPreRender and do this stuff.

-
Vadivel Kumar
http://vadivelk.net