如何获得Java确认脚本的答案 [英] how to get the answer of a java confirm script

查看:73
本文介绍了如何获得Java确认脚本的答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道如何在asp.net vb中使用此代码,所以我转向你们..
我怎样才能得到这个脚本的答案,或者更好的是,如何将它放在IF语句中?

i really don''t know how to use this code in asp.net vb, so i''m turning to you guys..
how may i get the answer of this script, or better yet, how may i put it in an IF statement?

(ClientScript.RegisterStartupScript(Me.GetType(), "confirm", "<script language=JavaScript>confirm(''Are you sure you want to delete this user?'');</script>"))

推荐答案

您没有阅读我建议的链接吗?

这里的要点是,确认仅返回true或false,因此很容易弄清楚已完成的操作.试试这个代码片段,但是您需要自己弄清楚如何最好地使用它:

Did you not read the links I suggested?

The point here is that the confirm only returns true or false so is easy to figure out what has been done. Try this code fragment but you''ll need to work out for yourself how to best use it:

public static void ConfirmButton(WebControl Control, string Message)
{
    if (Control != null)
    {
        Control.Attributes.Add("onclick", "javascript:if(confirm('" + Message + "') == false) return false;");
    }
}


这篇关于如何获得Java确认脚本的答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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