Feb 12, 2009, 3:54 AM
[CLOSED] confirm message problem
hi,
i am using confirm box in my project. when i click the button, the confirm box open and ask yes,no. if i click yes ,then only call the ajaxevent.My problem is before i click yes in message box, ajax event fires.
please see the code tell the solution.
Thanks in advance.
i am using confirm box in my project. when i click the button, the confirm box open and ask yes,no. if i click yes ,then only call the ajaxevent.My problem is before i click yes in message box, ajax event fires.
please see the code tell the solution.
Thanks in advance.
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Button1_Click(object sender, AjaxEventArgs e)
{
TextField1.Text = "success";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script>
var confirmSend1 = function()
{
return Ext.MessageBox.confirm('CONFIRM', 'Confirm send?', function Test(Button1) { if(Button1 == 'yes') { return true } else {return false} } );
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" Theme="Slate">
</ext:ScriptManager>
<ext:Button ID="Button1" runat="server" Text="success">
<Listeners>
<Click Fn="confirmSend1" />
</Listeners>
<AjaxEvents>
<Click OnEvent="Button1_Click"></Click>
</AjaxEvents>
</ext:Button>
<ext:TextField ID="TextField1" runat="server">
</ext:TextField>
</form>
</body>
</html>