Confirmation MessageBox using VB. (It's work)

  1. #1

    Confirmation MessageBox using VB. (It's work)

    Dear All Members,

    Please find the code below for your references if you need it. Thanks. / joe2014

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Test2.WebForm1" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
      
     <script runat="server">
         <DirectMethod>
         Protected Sub Confirm(ByVal sender As Object, ByVal e As EventArgs)
             'Ext.Net.X.MessageBox.Confirm("Test", "Are you sure?").Show()
    
             Dim myButtons As Ext.Net.MessageBoxButtonsConfig = New Ext.Net.MessageBoxButtonsConfig
    
             myButtons.Yes = New Ext.Net.MessageBoxButtonConfig
             myButtons.No = New Ext.Net.MessageBoxButtonConfig
             
             myButtons.Yes.Handler = "#{DirectMethods}.DoYes()"
             myButtons.Yes.Text = "Yes"
             
             myButtons.No.Handler = "#{DirectMethods}.DoNo()"
             myButtons.No.Text = "No"
             
             
             Ext.Net.X.MessageBox.Confirm("Test", "Are you sure?", myButtons).Show()
         End Sub
         
         <DirectMethod()>
         Public Sub DoYes()
             Ext.Net.X.Msg.Alert("DirectMethod", "DoYes").Show()
         End Sub
    
         <DirectMethod>
         Public Sub DoNo()
             Ext.Net.X.Msg.Alert("DirectMethod", "DoNo").Show()
         End Sub
    
         
     </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Button ID="Button1" runat="server" Text="Confirm" OnDirectClick="Confirm" />
        </div>
        </form>
    </body>
    </html>
  2. #2
    Hi @joe2014,

    Thank you for sharing!

    I've moved the thread to the Examples and Extras forum.

Similar Threads

  1. [CLOSED] MessageBox bug
    By Akpenob in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 29, 2013, 12:54 PM
  2. Replies: 0
    Last Post: Sep 05, 2011, 4:11 AM
  3. Messagebox confirmation and code to execute
    By unaltro2 in forum 1.x Help
    Replies: 2
    Last Post: Jan 08, 2010, 6:20 AM
  4. [CLOSED] MessageBox does not work in AjaxMethod
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 28, 2009, 9:50 AM
  5. Ext.MessageBox
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 26, 2009, 6:13 PM

Tags for this Thread

Posting Permissions