asp.net ajax 在updatepanel中使用alert提示方法

C#代码: ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('投票成功!')", true); VB代码: ScriptManager.RegisterStartupScript(Me.UpdatePanel1, Me.GetType(), "updateScript", "alert('投票成功!')", True) 代码已经测试通过,用这种方法来防止刷新不错 若不是在updatepanel中需要用alert提示信息,则可以使用如下代码(VB): Me.Page.ClientScript.RegisterStartupScript(Page.GetType(), "PopWin", "

", True) 此代码不能防止刷新,但是比直接写Response.Write("

")的用户体验要好!弹出提示框时不会造成当前页面空白!

posted @ 2010-07-23 10:39  rob_2010  阅读(198)  评论(0)    收藏  举报