I am using the following code inside a btn Click event:
ClientScript.RegisterStartupScript(typeof(Page), "exampleScript", "alert('you just registered the start up script');", true);
The script gets registered inside the <body> and I do not get any alert.
What’s the way to register startup script and get this alert message?
Are you using AJAX?
So whenever you have an instance of ScriptManager on your page, you need to register the Script using ScriptManager. So you need to change the code like this