Javascript提醒 [英] Javascript alert

查看:80
本文介绍了Javascript提醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回发后我需要一个弹出提醒。


1)用户点击提交按钮

2)服务器端代码运行,如果结果是假的我想显示一个java

脚本警报(它不起作用)


如何在显示后显示弹出消息回复?


谢谢

彼得

I need a popup alert after a post back.

1) user clicks on the submit button
2) Server side code runs and if the result is false I want to display a java
script alert("It did not work")

How to do I display a popup message after a postback ?

Thank You
Peter

推荐答案

尝试使用

this.Page.ClientScript.RegisterStartupScript


我重新调用它适用于AJAX。


George。


" Peter" < cz **** @ nospam.nospamwrote in message

news:uw ************** @ TK2MSFTNGP05.phx.gbl ...
Try to use
this.Page.ClientScript.RegisterStartupScript

I recal it works with AJAX.

George.

"Peter" <cz****@nospam.nospamwrote in message
news:uw**************@TK2MSFTNGP05.phx.gbl...

>回复后我需要一个弹出提醒。


1)用户点击提交按钮

2)服务器端代码运行,如果结果为false,我想显示一个

java脚本警报(它不起作用)


如何在回发后显示弹出消息?


谢谢


彼得

>I need a popup alert after a post back.

1) user clicks on the submit button
2) Server side code runs and if the result is false I want to display a
java script alert("It did not work")

How to do I display a popup message after a postback ?

Thank You
Peter




" George" < no ***** @ comcast.netwrote in message

news:uS ************* @ TK2MSFTNGP05.phx.gbl ...

"George" <no*****@comcast.netwrote in message
news:uS*************@TK2MSFTNGP05.phx.gbl...

尝试使用

this.Page.ClientScript.RegisterStartupScript


我重新使用AJAX。


乔治。


" Peter" < cz **** @ nospam.nospamwrote in message

news:uw ************** @ TK2MSFTNGP05.phx.gbl ...
Try to use
this.Page.ClientScript.RegisterStartupScript

I recal it works with AJAX.

George.

"Peter" <cz****@nospam.nospamwrote in message
news:uw**************@TK2MSFTNGP05.phx.gbl...

>>回复后我需要一个弹出提醒。

1)用户点击提交按钮
2)服务器边代码运行,如果结果为false,我想显示一个
java脚本警报(它不起作用)

如何在回发后显示弹出消息?

谢谢

彼得

>>I need a popup alert after a post back.

1) user clicks on the submit button
2) Server side code runs and if the result is false I want to display a
java script alert("It did not work")

How to do I display a popup message after a postback ?

Thank You
Peter



我已经尝试过了没有任何反应。

I''ve tried that already, nothing happens.


" Peter" < cz **** @ nospam.nospamwrote in message

news:uc ************** @ TK2MSFTNGP06.phx.gbl ...
"Peter" <cz****@nospam.nospamwrote in message
news:uc**************@TK2MSFTNGP06.phx.gbl...

>>>回复后我需要一个弹出提醒。
< 1)用户点击提交按钮
2)服务器端代码运行,如果结果为假,我想显示一个
java脚本警报(它不起作用)

如何在回发后显示弹出消息?
>>>I need a popup alert after a post back.

1) user clicks on the submit button
2) Server side code runs and if the result is false I want to display a
java script alert("It did not work")

How to do I display a popup message after a postback ?


尝试使用this.Page.ClientScript.RegisterStartupScript


Try to use this.Page.ClientScript.RegisterStartupScript



我已经尝试过,没有任何反应。


I''ve tried that already, nothing happens.



George'的回答是正确的。你有这样的东西......?


protected void MyButton_Click(object sender,System.EventArgs e)

{

bool blnResult =<做服务器端处理> ;;


if(!blnResult)

{

ClientScript.RegisterStartupScript (GetType(),failure,alert(''它

不起作用');",true);

}

}

-

Mark Rae

ASP.NET MVP
http://www.markrae.net

George''s response is correct. Do you have something like this...?

protected void MyButton_Click(object sender, System.EventArgs e)
{
bool blnResult = <do server-side processing>;

if (!blnResult)
{
ClientScript.RegisterStartupScript(GetType(), "failure", "alert(''It
did not work'');", true);
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


这篇关于Javascript提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆