The OK button is displayed when asp.net coolite is deleted.

Source: Internet
Author: User

The interface is as follows:
<Ext: Button ID = "btnDel" runat = "server" Icon = "Delete" Text = "Delete">
<Listeners> <Click Handler = "CompanyUser. DoConfirm ()"/> </Listeners>
</Ext: Button>
You also need to add such code
<Ext: ScriptManager ID = "ScriptManager1" runat = "server" AjaxMethodNamespace = "CompanyUser">
</Ext: ScriptManager>
This CompanyUser is the name of the Page you created, for example, <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "CompanyUser. aspx. cs "Inherits =" xitong_CompanyUser "%>
The methods in CS are as follows: Copy codeThe Code is as follows: // <summary>
/// Delete
/// </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 ("prompt", "deleted successfully"). Show ();
}
Else
{
Ext. MessageBox. Alert ("prompt", "deletion failed, no row selected! "). Show ();
}
BindStore ();
}
/// <Summary>
/// The delete dialog box is displayed.
/// </Summary>
[AjaxMethod]
Public void DoConfirm ()
{
Ext. Msg. Confirm ("message prompt", "delete selected row? ", New MessageBox. ButtonsConfig
{
Yes = new MessageBox. ButtonConfig
{
Handler = "CompanyUser. onDeleteClick ()",
Text = "yes"
},
No = new MessageBox. ButtonConfig
{
Text = "no"
}
}). Show ();
}

OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.