PDA

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



joe2014
Sep 26, 2014, 3: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">
<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>

Daniil
Sep 27, 2014, 7:51 AM
Hi @joe2014,

Thank you for sharing!

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