如何使用选中的复选框引发某些事件 [英] How to raise some event using checkbox selected

查看:110
本文介绍了如何使用选中的复选框引发某些事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含6行和一个复选框的Gridview。如果我选择一个复选框,我想提出一个事件。

在我的代码中,选中了复选框但未输入事件。是否应该进行任何更正或任何人可以指导我?

I have a Gridview with 6 rows and a checkbox. If I select one checkbox , I want to raise an event.
In my code, the checkbox is selected but not entering the event. Should any correction be made or can anyone guide me?

<asp:GridView ID="GridView1" runat="server"

style="z-index: 1; left: 195px; top: 495px; position: absolute; height: 152px; width: 232px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect1" runat="server" OnCheckedChanged="chkSelect1_checkedchanged"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>







protected void chkSelect1_checkedchanged(object sender, EventArgs e)
   {

   }

推荐答案

你不能提升事件,你可以处理事件。请参阅以下链接:



TemplateField ItemTmplate中的复选框



(示例)如何在gridview 中处理与模板文件相关的事件
You cannot RAISE events,you can HANDLE events.Refer to the links below:

Checkbox in TemplateField ItemTmplate

(Example)How to handle events related to template fileds in gridview


这篇关于如何使用选中的复选框引发某些事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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