Insert code in HEAD from page code?

  • Thread starter Thread starter Edwin Knoppert
  • Start date Start date
E

Edwin Knoppert

In this case i want to execute some ASP.NET code from a location near a
webcontrol.
Usually no problem except i need to include a js file and best would be in
the HEAD.
It's not useful at the end.

Inserting the js include before this control is also ok.
From page_load or _init it works well, not when i move this near the
control.
The line is not produced.

Using:
Page.ClientScript.RegisterClientScriptInclude("theuniquetaghere", sFilename)

Yes, due (flawed) design multiple inserts can happen.
ASP.NET still includes one as desired.
 
You should use
Page.RegisterClientScriptBlock
with
Page.IsClientScriptBlockRegistered

George
 
Why?
I'm not looking for a test, i'm looking for a way to insert the js file
include.
Preferred in the HEAD.
ASP.NET maintains the 'overwrites' by himself.
 

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