RegisterClientScriptBlock
I saw this recent MSDN TV episode about ASP.NET client side
script handling. As a sworn hater of client side scripts I played the clip in
horror, but found that as long as I can assign these scrips to my pages
serverside (and dynamically) they are actually pretty cool.
The first use I got for this snippet was for dynamically assigning CSS
templates to pages based on user preferences:
In PreRender (or Init):
this.RegisterClientScriptBlock("css", "<link href='"+ myVariableWithCSSFilename +"'
rel=stylesheet/>");