20分求助datagriwview里的radiobutton onclick事件的问题!
<asp:GridView ID= "gvBrand " runat= "server " Width= "300px " AutoGenerateColumns= "False " >
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID= "lblCheck " runat= "server " Text= "选中 "> </asp:Label>
</HeaderTemplate>
<ItemStyle HorizontalAlign= "Center " VerticalAlign= "Top " />
<ItemTemplate>
<input runat= "server " type=radio id= "RadioName " name= "RadioName " value= ' <%# DataBinder.Eval(Container.DataItem, "Id ")%> '/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField= "Id " HeaderText= "品牌类型 " />
</Columns>
</asp:GridView>
===
RadioName点击时如何得到这个事件,搞不懂!
[解决办法]
在DataGrid的ItemCreate事件中给RadioName链接事件,就跟普通事件一样处理即可.
如果是onchange事件每次都触发服务器事件的话,设置autoPostBack属性为真.
onclick事件的话加上Page.GetPostBackEventReference添加回调脚本,然后可在其onclick事件中调用__doPostBack