By default, the script writes to the output, but without tags <script>. You would probably notice this if you use the browser JavaScript console or view the resulting HTML on the client. Be sure to check out these tools.
script .
Page.ClientScript.RegisterStartupScript(this.GetType(), "MyKey", "WantToSave();", true);
:
Page.ClientScript.RegisterStartupScript(this.GetType(), "MyKey", "<script>WantToSave();</script>");
, , script, script. , - , - .