UpdatePanel内に配置したコントロール(ボタン等)の処理(サーバサイド)でクライアントスクリプトを出力する方法を記述します。 UpdatePanelを利用しない場合は、コントロールのAttributeを利用したり、Page.RegisterClientScriptBlockを利用しますが、UpdatePanel内ではこれらは動作しません。 UpdatePanelと併用する場合には、ScriptManager.RegisterClientScriptBlock( )メソッドを利用します。 サーバサイド処理後にalertスクリプトを出力する例は以下となります。(以下の処理はPage内の処理です。thisはPageを示します) string clientScript = "<script language='JavaScript'> alert('アラート!') </script>";
![UpdatePanel内のコントロールのサーバサイド処理でクライアントスクリプトを出力する方法 - 35才SE限界説への抵抗記](https://cdn-ak-scissors.b.st-hatena.com/image/square/d8b12394a82d4b51c6347fc87917d05f246c85d6/height=288;version=1;width=512/http%3A%2F%2Fredraccoondog35.cocolog-nifty.com%2F.shared-pleasy%2Fnifty_managed%2Fimages%2Fweb%2Fogp%2Fdefault.png)