我如何从文件后面的代码中调用确认框 [英] How do i call confirm box from code behind file

查看:82
本文介绍了我如何从文件后面的代码中调用确认框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论用户单击确定"还是取消"以进行删除操作,我如何在文件后面的代码中调用确认框并在linkbutton_click()事件中收集结果?

How do i call confirm box in code behind file and collect the result in linkbutton_click() event whether user clicked on OK or Cancel for delete operation?

推荐答案

window.write(< script> 在这里写你的JS </script>");


谢谢,
Ambesha
window.write("<script>write your JS here</script>");


Thanks,
Ambesha


阅读以下内容:http://www.dreamincode.net/forums/topic/185586-aspnet-calling-javascript-from-code-behind/ [
Read this: http://www.dreamincode.net/forums/topic/185586-aspnet-calling-javascript-from-code-behind/[^]


ScriptManager.RegisterStartupScript(this, typeof(string), "Error", "ConfirmUser('Are u sure');", true);

<script type='javascript'>
 function ConfirmUser(msg)
 {
  if(confirm(msg))
    __doPostBack('','');
 }
<script>


这篇关于我如何从文件后面的代码中调用确认框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆