Wednesday, December 31, 2008

Add JavaScript from CodeBehind

Utilize the RegisterStartupScript() function in the Page Load event:

ClientScript.RegisterStartupScript(GetType(Page), "keyname", "<script>//javascript here</script>")

Where "keyname" can be any unique key name as string.

No comments: