Ok I have a bit of a problem with a Server control I am building. I need to
write a client-side Javascript block between the open and closing Head tag.
I have tried the following methods:
first attempt
Page.Response.A ppendHeader(som eStringBuilder) ;
result:
Returned nothing on the page.
Second attempt
if(!Page.IsStar tupScriptRegist ered("startup") ){
StringBuilder jsLoad=new StringBuilder() ;
jsLoad.Append(@ "Some Javascript");
string CMSCScript=jsLo ad.ToString();
Page.RegisterCl ientScriptBlock ("startup",CMSC Script);
}
Result:
Returned Client Script at the top between the Open and Close <Body> tags.
I need to place the script block between the Open and Close <Head> tags.
Can someone tell me how this is done? By the way, for the above code I
override the PreRender() method.
Can someone please help me with this or lead me to the right web site for a
guide. Thank you.
I am Sam- :-)