asp.net coolite 刪除時彈出確定按鈕
來源:懂視網(wǎng)
責(zé)編:小采
時間:2020-11-27 22:43:57
asp.net coolite 刪除時彈出確定按鈕
asp.net coolite 刪除時彈出確定按鈕:界面上如下: <ext:Button ID=btnDel runat=server Icon=Delete Text=刪除 > <Listeners ><Click Handler=CompanyUser.DoConfirm()/></Listeners> </ext:Butt
導(dǎo)讀asp.net coolite 刪除時彈出確定按鈕:界面上如下: <ext:Button ID=btnDel runat=server Icon=Delete Text=刪除 > <Listeners ><Click Handler=CompanyUser.DoConfirm()/></Listeners> </ext:Butt
界面上如下:
<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 了
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
asp.net coolite 刪除時彈出確定按鈕
asp.net coolite 刪除時彈出確定按鈕:界面上如下: <ext:Button ID=btnDel runat=server Icon=Delete Text=刪除 > <Listeners ><Click Handler=CompanyUser.DoConfirm()/></Listeners> </ext:Butt