如何使用csharp在asp.net中使用确认框 [英] how to use confirmation box in asp.net using csharp

查看:76
本文介绍了如何使用csharp在asp.net中使用确认框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用csharp在asp.net中使用确认框。



请帮帮我。



我怎样才能使用csharp。



Rgds,

Narasiman P

解决方案

您好。您可以在页面后面的代码中使用scriptmanager来实现这一点。



 ScriptManager.RegisterStartupScript( this  this  .GetType(),Guid.NewGuid()。ToString(),  javascript:confirm('您的消息......') true ); 





如果单击确定按钮,确认功能将返回真,单击取消按钮时,确认功能将返回假。因此,请根据点击的按钮执行操作....


 btnDelete.Attributes.Add(  onClick  return confirm('do你想继续')); 


how to use confirmation box in asp.net using csharp.

please help me.

how can i do using csharp.

Rgds,
Narasiman P

解决方案

Hi. you can use scriptmanager for this from your code behind page..

ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "javascript:confirm('your message...')", true);



Confirm function will return 'true' if 'OK' button is clicked and 'false' when 'Cancel' button is clicked. So perform your actions based on the button clicked....


btnDelete.Attributes.Add("onClick","return confirm('do you want to continue')");


这篇关于如何使用csharp在asp.net中使用确认框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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