Coolite pop-up window

Source: Internet
Author: User

① The prompt box is written in the background:

Front-end code:

 

Code

<Script type = "text/javascript">

Function DelSelectedRowFn (){

Ext. MessageBox. confirm ('hprompt ', 'whether to delete these records', function (btn ){

If (btn = "yes "){

Coolite. AjaxMethods. DeleteSelectedRow (); // executes the background method.

}

});

}

</Script>

 

<Ext: Button ID = "ButtonDel" runat = "server" Text = "delete test">

<Listeners>

<Click Fn = "DelSelectedRowFn"/>

</Listeners>

</Ext: Button>

 

 

Background code:

 

Code

[AjaxMethod]

Public void DeleteSelectedWorkFlow ()

{

// Write the logic code for deletion first...
 

// If the deletion is successful, the following prompt is displayed.
Ext. Msg. Show (new MessageBox. Config

{

Title = "prompt ",

Message = "you have successfully deleted this record! ",

Buttons = MessageBox. Button. OK,

AnimEl = this. ButtonDel. ClientID,

});

}

 

 

② The prompt box is written at the front end:

Front-end code:

 

Code

<Script type = "text/javascript">

// After the deletion example is successful, a prompt box is displayed at the front end.

Function DelSelectedRowFn2 (){

Ext. MessageBox. confirm ('hprompt ', 'Do you really want to delete this record?', function (btn ){

If (btn = "yes "){

Coolite. AjaxMethod. request ("DeleteSelectedRow2 ",{

Success: function (result ){

Ext. Msg. alert ("prompt", result );

},

EventMask :{

ShowMask: true,

Msg: 'deleting... ', please wait ...',

MinDelay: 500

}

});

}

});

}

</Script>

<Ext: Button ID = "Button3" runat = "server" Text = "after deletion is successful, a dialog box is displayed at the front-end (ExtJS)">

<Listeners>

<Click Fn = "DelSelectedRowFn2"/>

</Listeners>

</Ext: Button>

 

 

Background code:

 

[AjaxMethod]

Public string DeleteSelectedRow2 ()

{

// Write the deleted logic code first.

// A string is returned after deletion.
Return "you have successfully deleted it! ";

}

 

 

3. Write all in the background:

 

Code

Protected void button#click (object sender, AjaxEventArgs e)

{

Ext. Msg. Alert ("prompt", "message content", new MessageBox. ButtonsConfig

{

Yes = new MessageBox. ButtonConfig

{

Handler = "Coolite. AjaxMethods. DoYes ()",

Text = "OK"

},

No = new MessageBox. ButtonConfig

{

Handler = "Coolite. AjaxMethods. DoNo ()",

Text = "cancel"

}

}). Show ();

}

 

// Server method:

[AjaxMethod]
Public void DoYes ()

{

Ext. Msg. Alert ("Operation prompt", "deleted successfully! "). Show ();

}

 

[AjaxMethod]
Public void DoNo ()

{

Ext. Msg. Alert ("Operation prompt", "You just clicked cancel"). Show ();

}

}

}

 

 

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.