Dear All,
Please tell me how to use the confirm message box using server side code in vb.net. Also please do not refer to the client side code of examples explorer.
Regards
MAhmood
Printable View
Dear All,
Please tell me how to use the confirm message box using server side code in vb.net. Also please do not refer to the client side code of examples explorer.
Regards
MAhmood
Hi,
Here you are.
Example
Code:<%@ Page Language="VB" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
Protected Sub Confirm(sender As Object , e As DirectEventArgs)
ExtNet.Msg.Confirm("Confirm?", "Are you sure?", "confirmHandler(buttonId);").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>Ext.NET Example</title>
<script type="text/javascript">
var confirmHandler = function (buttonId) {
alert("The '" + buttonId + "' button is clicked.");
};
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Button runat="server" Text="Confirm" OnDirectClick="Confirm" />
</body>
</html>
Dear Daniel,
How can i use that from code behind. i do not want to use script.
Regards
Mahmood
Please provide more details about the requirement.
I'm afraid I don't understand well what you mean here:
Quote:
How can i use that from code behind.
Well, there is no such thing in Ext.NET to get a Confirmation dialog box without JavaScript at all.
Generally, all Ext.NET controls use JavaScript in a varying degree.
To avoid JavaScript at all you could implement your own confirmation dialog using common ASP.NET controls with common PostBack events.
Returning back to my example. If you just need to call server-side code on clicking "Yes" or "No", you could call a respective DirectMethod from JavaScript.