在条件检查中确认消息,而不是单击按钮 [英] Confirm message on condition checking not on button click

查看:66
本文介绍了在条件检查中确认消息,而不是单击按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if (allowtoemail == totalemail)
{
   if (!this.Page.ClientScript.IsClientScriptBlockRegistered("ClsoeME91"))
      this.Page.ClientScript.RegisterStartupScript(this.GetType(),
      "ClsoeME91", 
      "<script language = 'javascript'>window.confirm('You can not send more email. Go to Pricing...');</script>");

// this is the confirm message if i click on ok then our two line below execute 

如果我单击取消",那么下面的代码将无法执行

if I click on cancel then below code not execute how can i do

RadTabStrip2.SelectedIndex = 4; 
RadMultiPage2.SelectedIndex = 4; 

我们上面的代码无法正常工作

our above code is not working properly

如何正确执行此代码……

how can do the correct this code......

推荐答案

您可以考虑将ASP.NET标记添加到您的ASP.NET问题,那就是标记的用途.

you might consider adding the ASP.NET tag to your ASP.NET questions, that''s what the tags are for.

您的代码无法使用.在回发开始后,它将显示此弹出窗口,效率不高.它也不会检查确认调用的返回值,因此它总是做同样的事情.是否可以在客户端进行此检查,您可以将OnClientClick事件添加到按钮,并且如果该事件返回false,则不会发生回发.

your code cannot work.  It will show this popup after a postback for a start, which is hardly efficient.  It also doesn''t check the return value of the confirm call, therefore it always does the same thing.  Is it possible to do this check on the client side, you can add an OnClientClick event to a button and if it returns false, the postback will not occur.


这篇关于在条件检查中确认消息,而不是单击按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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