复制代码 代码如下:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
[DirectMethod]
public void DoConfirm()
{
X.Msg.Confirm("Message", "Confirm?", new MessageBoxButtonsConfig
{
Yes = new MessageBoxButtonConfig
{
Handler = "CompanyX.DoYes()",
Text = "Yes Please"
},
No = new MessageBoxButtonConfig
{
Handler = "CompanyX.DoNo()",
Text = "No Thanks"
}
}).Show();
}
[DirectMethod]
public void DoYes()
{
this.Label1.Text = "YES";
}
[DirectMethod]
public void DoNo()
{
this.Label1.Text = "NO";
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Confirm MessageBox with ButtonsConfig - Ext.NET Examples</title>
<link href="/resources/css/examples.css" type="text/css" />
</head>
<body>
<ext:ResourceManager runat="server" DirectMethodNamespace="CompanyX" />
<form runat="server">
<p>
<ext:Button runat="server" Text="Confirm" Icon="Error">
<Listeners>
<Click Handler="CompanyX.DoConfirm()" />
</Listeners>
</ext:Button>
</p>
</form>
</body>
</html>
复制代码 代码如下:
<body>
<ext:ResourceManager runat="server" DirectMethodNamespace="CompanyX" />
<form runat="server">
<p>
<ext:Button runat="server" Text="Confirm" Icon="Error">
<DirectEvents>
<Click OnEvent="Confirm">
<Confirmation ConfirmRequest="true" Message="您确定要删除么?" />
</Click>
</DirectEvents>
</ext:Button>
</p>
</form>
</body>
复制代码 代码如下:
protected void Confirm(object sender, DirectEventArgs e)
{
X.Msg.Alert("点击提示", "您点击了确定,执行的是后台事件!").Show();
}
新闻热点
疑难解答
图片精选