我有一个页面,它接受用户的输入,然后通过单击按钮处理他的请求。在此按钮单击事件上,我需要验证他输入的输入,并在某些情况下显示确认对话框。如果他单击是,那么我需要执行进一步的操作,否则返回。
我试过使用
Page.ClientScript.RegisterStartupScript(this.GetType(), Constants.OpenConfirm, "confirm('Data Already Exists, do you Wish to Overwrite the existing record?')", true);
但无论我单击是还是否,它都在执行进一步的操作。
已经尝试使用从服务器端调用的 JavaScript 方法,但这也行不通。