服务器端的确认框
问题描述:
如何在服务器端按钮单击事件上调用确认消息框,因为如果用户单击确定按钮我想执行某些操作,否则执行其他代码如果单击取消 '按钮。
谢谢。
How can call confirm message box on server side button click event because I want to perform some operation if user click on 'ok' button else execute other code if it click on 'cancel' button.
thank you.
答
试试这段代码,
它会帮助你..
Try this code,
it will help you..
string script = " if (confirm(' do you want to perform this operation???')) window.location='transactionpage.aspx'";
Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", script, true);