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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top