VB.NET - Page.RegisterStartupScript in VS2010 - Asked By chie_hitech y on 09-Aug-12 08:08 AM

For this code in Framework 1.1 :  Page.RegisterStartupScript("myScript", myScript), I am getting error in VS2010.

Public Overridable Sub RegisterStartupScript(key As String, script As String)' is obsolete :

In order to fix this in Framework 2010, what is the best way?

ClientScript.RegisterStartupScript(Page.GetType(), "myScript", myScript) or
ClientScript.RegisterStartupScript(Me.GetType(), "myScript", myScript)
Danasegarane Arunachalam replied to chie_hitech y on 09-Aug-12 08:40 AM

The Page.RegisterStartupScript is now obsolute, you need to use the other method
ClientScriptManager.RegisterStartupScript Method

For 2010 you need to use the ClientScriptManager.RegisterStartupScript Method only