更新时间:2023-10-02 16:39:16
您没有阅读我建议的链接吗?
这里的要点是,确认仅返回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;");
}
}