zoukankan      html  css  js  c++  java
  • Winform与Webform中的对话框

    参考MSDN

    DialogResult result = MessageBox.Show("见过打劫的没?", "打、打、打劫", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
    switch (result)
    {
        case DialogResult.OK:
            MessageBox.Show("你按了确定");
            break;
        case DialogResult.Cancel:
            MessageBox.Show("你按了取消");
            break;
    }

    【lxcnn】:
    抱歉,最近头晕,看成winform了,webform我再看下代码



    【GaoFX】:
    你如果想在CodeBehind代码过程中弹出对话框让用户作出选择,呵呵,俺认为是不可能的。
    如果是在页面的客户端脚本中,太多了,可以window.confirm,也可以自己写一个页面showModalDialog显示出来。

    【lxcnn】:
    看你想实现什么样的效果吧

    Response.Write("<script languge=javascript'>if(confirm('你确定结贴?')){alert('你按了确定')}else{alert('你按了取消')}</script>");

    另一种是在Page_Load里加
    Button1.Attributes.Add("onclick", "return confirm('你确定要结帖吗?')");
    点确定执行Click事件,点取消则不执行


    【yanming_01】:
    假设你要实现的是删除一条语句    
    但你要做2次判断

    用个textBox来说明
    if(){Response.Write("<script>alert('你却定删除吗!');</script>");}
        else 
    {Response.Write("<script>alert('取消删除!');</script>");}
  • 相关阅读:
    Lucene.NET中Field.Index 和 Field.Store的几种属性的用法
    WP7学习笔记(三)
    sql注入
    JSP数据库开发实例
    oracle命令大全(转)
    .net个人涉及
    JavaScript的错误处理之onerror事件的使用方法
    脚本问题。调试
    做到了,你就成熟
    ea8.0
  • 原文地址:https://www.cnblogs.com/nianshi/p/1030724.html
Copyright © 2011-2022 走看看