在GRID等容器中的RadioButton的单选问题

Posted on 2007-07-23 21:42  IT蚂蚁  阅读(273)  评论(0编辑  收藏  举报
由于在容器中的RadioButton的GroupName 会变,会自动加上序号,所以点选失效。
我们可以自己手动输出<input>实现点选


模版列中加以个label,id为lblradio  
  在ItemDataBound绑定事件中写  
  Label   lblradio=   (Label)e.Item.FindControl("lblradio");  
  lblradio.Text   =   "<input   type=radio   name='myradiogroup'   value="   +   e.Item.Cells[1].Text   +   ">";  
   
  接收选择的值  
  string   str   =   Request.Form["myradiogroup"];    

Copyright © 2024 IT蚂蚁
Powered by .NET 8.0 on Kubernetes