View Full Version : Confirmation MessageBox using VB. (It's work)

Sep 26, 2014, 4:19 PM
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">
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

Public Sub DoYes()
Ext.Net.X.Msg.Alert("DirectMethod", "DoYes").Show()
End Sub

Public Sub DoNo()
Ext.Net.X.Msg.Alert("DirectMethod", "DoNo").Show()
End Sub

<!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">
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button1" runat="server" Text="Confirm" OnDirectClick="Confirm" />

Sep 27, 2014, 8:51 AM
Hi @joe2014,

Thank you for sharing!

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