如何使用c#在asp.net中使用复选框显示弹出窗口 [英] how to show the popup using checkbox in asp.net using c#
本文介绍了如何使用c#在asp.net中使用复选框显示弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在运行模式下如下所示
复选框是否要发送短信
如果用户单击复选框,我想显示弹出窗口
在弹出消息中如下所示
是否
为此,我该如何使用c#在asp.net中进行操作.
问候,
Narasiman P.
In run mode as follows
checkbox do you want to send sms
If user click the checkbox i want to show the popup
In popup message as follows
Yes No
for that how can i do in asp.net using c#.
Regards,
Narasiman P.
推荐答案
下面的代码将解决您的问题
below is the code that will solve your problem
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged"/>
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox1.Attributes.Add("onclick", "return confirm('are u sure?')");
}
使用updatepanel处理回发
handle post back with updatepanel
这篇关于如何使用c#在asp.net中使用复选框显示弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文