Telerik的RadButton
控件包含一個內置功能,用於顯示確認消息。最重要的是,您可以通過使用RadConfirm
或RadWindow
控件來自定義彈出窗口體驗,這並不難實現。請務必查看附加鏈接瞭解更多詳情。
ASPX
<telerik:RadButton RenderMode="Lightweight" ID="btnStandardConfirm" runat="server" Text="Standard window.confirm" OnClientClicking="StandardConfirm" OnClick="Button_Click">
</telerik:RadButton>
代碼
protected void Button_Click(object sender, EventArgs e)
{
RadButton btn = sender as RadButton;
switch (btn.ID)
{
case "btnStandardConfirm":
Label1.Text = "The <strong>StandardButton</strong> submitted the page at: " + DateTime.Now.ToString();
break;
}
}
JS
function StandardConfirm(sender, args) {
args.set_cancel(!window.confirm("Are you sure you want to submit the page?"));
}
演示鏈接背後: http://demos.telerik.com/aspnet-ajax/button/examples/confirm/defaultcs.aspx
,你得到什麼錯誤? –