Adding script block to <head>

  • Thread starter Thread starter Steve C. Orr [MVP, MCSD]
  • Start date Start date
S

Steve C. Orr [MVP, MCSD]

Put this in the HTML view of your header section:

<%=MyScriptBlockFunction()%>

Then define MyScriptBlockFunction to return whatever script text you'd like.
 
Stick an asp:literal control in the head section and then set the text
property of the literal to your js function.
 
We've done a separate control called Linker which is located in <head>
and is notified by other controls (on prerender phase) when its
necessary to add link to css or js, or some <script> code.
 
Anybody know how to add a script block to the html <head> section
programmatically without using the 'RegisterScriptBlock' functions?
 
Back
Top