DataGrid里面嵌套了RadioBottonList控件,如何得到选择RadioBottonList的事件,如SelectedIndexChanged事件。
解决方案 »
- 40分啦,,,简单问题
- web service 引用dll
- rendercontrol 怎么用啊
- 急........在线等.....net绑定数据字符输出位数设置
- csdn的在线即时聊天怎么做的?
- ((TextBox)gr.Cells[1].Controls[0]).Text.Trim();为什么取到的是以前的值?而不是改过之后的值?
- 用程序读取WORD文档中表格的数据
- 抢分: 50分 http://www.shiseido.co.jp/做成这样的网站大约要多少钱?
- 请问SQL SERVER 2005中"标识种子"下面的一个选项"不用于复制"是什么作用?
- 关于IE10的服务器控件兼容问题
- 如何能点击超级链接执行.bat文件
- 不知道怎么形容的问题
{
if((e.Item.ItemType == ListItemType.Item) ||
(e.Item.ItemType == ListItemType.AlternatingItem))
{
((CheckBoxList)e.Item.FindControl("CheckBoxListID")).SelectedIndexChanged+=new EventHandler(CheckBoxList1_SelectedIndexChanged);
}
}private void CheckBoxList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
然后在Item_command()事件中
if(e.CommonName.equals("你设的值"))
{
控件的事件
}
==================
前台我就不怎么写代码了,就针对你的radionbutton写一下
<asp:RadioButton ID="rdb" Runat="server" AutoPostBack="True"OnCheckedChanged="rdb_CheckedChanged"></asp:RadioButton>那么在后台要这样 Protected Sub rdb_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If CType(sender, RadioButton).Checked = True Then
Response.Write("<script>alert('OK!');</script>")
End If
End Sub记住这里要用Protected关键子
问题倒是得到解决,用ItemCreaded来邦定SelectedIndexChanged事件,只是感觉对ItemCreaded事件不是很了解,很想通过其他方法来解决。