Ext.net 弹出对话框的几种方式(js 后台)

在ext.net中 经常会遇到需要弹出对话框进行选择的操作 目前总共发现了两种方式 一种为前台js脚本 另一种则是写在.cs文件中 如下:

1. js脚本:

Ext.Msg.confirm('系统提示', '确定要删除' + curNode.attributes.shopName + '餐厅信息吗?', function (btn) {
                if (btn == 'yes') {
                    Ext.net.DirectMethods.DelShopInfo(curNode.attributes.shopId, curNode.attributes.meaId, {
                        success: function () {
                            mi_meaDel.setDisabled(false);
                            mi_shopDel.setDisabled(true);


                            TabPanel1.addTab(pMeaShops);
                            TabPanel1.closeTab(pShopInfo);
                        },
                        failure: function (errorMsg) {
                            Ext.Msg.alert('Failure', errorMsg);
                        }
                    });
                }
 }, this);


var config = {
                    title: "提示",
                    msg: "确定删除日时段信息?",
                    closable: false,
                    buttons: Ext.MessageBox.OKCANCEL,
                    icon: Ext.MessageBox.QUESTION,
                    animEl: "fly",
                    fn: function (btn) {
                        if (btn == "ok")
                            Ext.net.DirectMethods.DelDayInfo(record.data.DAYTIMEID);
                    }
                };
Ext.MessageBox.show(config);

2. C#:

ExtNet.Msg.Confirm("提示", "如果删除用户,将清空用户的所有相关信息,确定要删除吗?", new MessageBoxButtonsConfig
        {
            Ok = new MessageBoxButtonConfig
            {
                Handler = "Ext.net.DirectMethods.DelUser(" + sel_userid.Text + ",{ failure: function (errorMsg) { Ext.Msg.alert('失败', '删除用户信息失败');}});",
                Text = "确定"
            },
            Cancel = new MessageBoxButtonConfig
            {
                Text = "取消"
            }
        }).Show();
 ExtNet.MessageBox.Show(new MessageBoxConfig()
            {
                Icon  = MessageBox.Icon.ERROR,
                Title = "提示",
                Message = "用户名或密码不能为空!",
                AnimEl = "fly",
                Modal = true,
                Buttons  = MessageBox.Button.OK
            });




发布了24 篇原创文章 · 获赞 1 · 访问量 2万+
展开阅读全文

Ext.Net1.7 后台操作页面超时 并 实现进度条的问题

10-01

![](https://img-ask.csdn.net/upload/201510/01/1443698718_356785.png) 需要达到如图样式 protected void Page_Load(object sender, EventArgs e) { } private static string TableName; //要修改的表名 [DirectMethod(Timeout = 900000)] protected void btnOK_DirectClick(object sender, Ext.Net.DirectEventArgs e) { UpHouse(); } [DirectMethod(Timeout=900000)] public void UpHouse() { try { TableName = this.txtTable.Text.Trim(); DataTable dt = GetDataReader("select distinct HouseCode from " + TableName + " order by HouseCode"); //获取非重复的数据 foreach (DataRow dr in dt.Rows) { string HouseCode = dr["HouseCode"].ToString(); string strSql = "select Id,HouseCode,HouseNo from " + TableName + " where HouseCode = '" + HouseCode + "' order by HouseCode"; DataTable dtr = GetDataReader(strSql); for (int i = 0; i < dtr.Rows.Count; i++) { string HouseCode_new = dtr.Rows[i]["HouseCode"].ToString().Trim(); string HouseNo = dtr.Rows[i]["HouseNo"].ToString().Trim(); string HouseId = dtr.Rows[i]["Id"].ToString().Trim(); if (HouseCode_new != HouseNo) { string UdSql = "Update " + TableName + " set HouseNo = '" + HouseCode_new + "' where Id = " + HouseId; UpdateDataReader(UdSql); break; } } } X.Msg.Alert("提示", "修改成功!").Show(); } catch (Exception e) { X.Msg.Alert("提示", "修改失败!" + e.Message).Show(); } } #region 数据处理 public static string strConn = "Data source=localhost;database=HH;user id=sa;pwd=sa;"; public static DataTable GetDataReader(string strSql) { using (SqlConnection connection = new SqlConnection(strConn)) { DataTable dt = new DataTable(); try { SqlDataAdapter command = new SqlDataAdapter(strSql, strConn); connection.Open(); command.Fill(dt); } catch (Exception ex) { connection.Close(); throw new Exception(ex.Message); } finally { connection.Close(); } return dt; } } public static int UpdateDataReader(string strSql) { using (SqlConnection connection = new SqlConnection(strConn)) { DataSet ds = new DataSet(); try { SqlCommand command = new SqlCommand(strSql, connection); connection.Open(); if (command.ExecuteNonQuery() > 0) { return 1; } else { return 0; } } catch (Exception ex) { connection.Close(); throw new Exception(ex.Message); } finally { connection.Close(); } } } #endregion } } 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览