讓ASP.NET或ASP.NET AJAX彈出MessageBox

讓ASP.NET或ASP.NET AJAX彈出MessageBox

最近小舖很多人在討論這個問題...

小弟我整理出ASP.NET與ASP.NET AJAX

分別如何彈出MessageBox的方法...分享給大家呀..

C#範例

1.適用ASP.NET

1 Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "msg", "<script>alert('HelloWorld!');</script>");


2.適用ASP.NET AJAX

1 ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"msg","alert('HelloWorld!')",true);