SeyoS
SeyoS

Reputation: 681

How to write Javascript from code behind at the end of HTML page

I want to write javascript from code behind but at the end of my HTML document. With Response.Write, I can write at the beginning of the file but how can I write at the end or in an other place ?

Thanks for your help !

Upvotes: 0

Views: 985

Answers (1)

Kieran Quinn
Kieran Quinn

Reputation: 1115

Write your JS function at the bottom of the HTML document, then just call it in the page load event in code behind file with

ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:someFunction();", true);

Upvotes: 1

Related Questions