S
Sam Samnah
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.AppendHeader(someStringBuilder);
result:
Returned nothing on the page.
Second attempt
if(!Page.IsStartupScriptRegistered("startup")){
StringBuilder jsLoad=new StringBuilder();
jsLoad.Append(@"Some Javascript");
string CMSCScript=jsLoad.ToString();
Page.RegisterClientScriptBlock("startup",CMSCScript);
}
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-
write a client-side Javascript block between the open and closing Head tag.
I have tried the following methods:
first attempt
Page.Response.AppendHeader(someStringBuilder);
result:
Returned nothing on the page.
Second attempt
if(!Page.IsStartupScriptRegistered("startup")){
StringBuilder jsLoad=new StringBuilder();
jsLoad.Append(@"Some Javascript");
string CMSCScript=jsLoad.ToString();
Page.RegisterClientScriptBlock("startup",CMSCScript);
}
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-