当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > asp.net coolite 删除时弹出确定按钮

ASP.NET
ASP.NET入门教程:ArrayList对象
ASP.NET入门教程:Hashtable对象
ASP.NET入门教程:SortedList对象
ASP.NET入门教程:把XML文件绑定到列表控件
ASP.NET入门教程:Repeater控件
ASP.NET入门教程:DataList控件
ASP.NET入门教程:数据库连接
ASP.NET入门教程:ASP.NET 2.0新特性
ASP.NET入门教程:ASP.NET 2.0母版页
ASP.NET入门教程:ASP.NET 2.0导航
ASP.NET入门教程:HTML服务器控件
ASP.NET入门教程:Web服务器控件
ASP.NET入门教程:Validation服务器控件
HTML服务器控件介绍:HtmlAnchor控件
HTML服务器控件介绍:HtmlButton控件
HTML服务器控件介绍:HtmlForm控件
HTML服务器控件介绍:HtmlGeneric控件
HTML服务器控件介绍:HtmlImage控件
HTML服务器控件介绍:HtmlInputButton控件
HTML服务器控件介绍:HtmlInputCheckBox控件

ASP.NET 中的 asp.net coolite 删除时弹出确定按钮


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-11   浏览: 102 ::
收藏到网摘: n/a

如果用coolite的 Confirm() 是不知道你选择了什么的 如上代码才可以的 界面上如下:
<ext:Button ID="btnDel" runat="server" Icon="Delete" Text="删除" >
<Listeners ><Click Handler="CompanyUser.DoConfirm()"/></Listeners>
</ext:Button>
还需要注意要加句这样的代码
<ext:ScriptManager ID="ScriptManager1" runat="server" AjaxMethodNamespace="CompanyUser">
</ext:ScriptManager>
这个的CompanyUser 就是你建立页面的名称如:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CompanyUser.aspx.cs" Inherits="xitong_CompanyUser" %>
CS里面的方法如下
复制代码 代码如下:

/// <summary>
/// 删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
///
[AjaxMethod]
public void onDeleteClick()
{
Coolite.Ext.Web.CheckboxSelectionModel rsm = GridPanel1.SelectionModel.Primary as Coolite.Ext.Web.CheckboxSelectionModel;
int count = 0;
foreach (Coolite.Ext.Web.SelectedRow sm in rsm.SelectedRows)
{
count = user.DeleteCompanyUser(int.Parse(sm.RecordID));
}
if (count > 0)
{
Ext.MessageBox.Alert("提示", "删除成功").Show();
}
else
{
Ext.MessageBox.Alert("提示", "删除失败,没有选中行!" ).Show();
}
BindStore();
}
/// <summary>
/// 弹出删除对话框
/// </summary>
[AjaxMethod]
public void DoConfirm()
{
Ext.Msg.Confirm("消息提示", "是否删除选中行?", new MessageBox.ButtonsConfig
{
Yes = new MessageBox.ButtonConfig
{
Handler = "CompanyUser.onDeleteClick()",
Text = "是"
},
No = new MessageBox.ButtonConfig
{
Text = "否"
}
}).Show();
}

就OK 了