<EditItemTemplate>
<asp:RadioButtonList id=sex runat="server" RepeatDirection=Horizontal SelectedValue='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==0?0:1 %>' >
<asp:ListItem Value=1>男</asp:ListItem>
<asp:ListItem Value=0>女</asp:ListItem>
</asp:RadioButtonList>
</EditItemTemplate>
在cs中怎么取到选择的这个值??
TextBox空间是这样取到的
string city = ((TextBox)e.Item.Cells[1].Controls[1]).Text;
那么RadioButtonList 控件怎么写法??
<asp:RadioButtonList id=sex runat="server" RepeatDirection=Horizontal SelectedValue='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==0?0:1 %>' >
<asp:ListItem Value=1>男</asp:ListItem>
<asp:ListItem Value=0>女</asp:ListItem>
</asp:RadioButtonList>
</EditItemTemplate>
在cs中怎么取到选择的这个值??
TextBox空间是这样取到的
string city = ((TextBox)e.Item.Cells[1].Controls[1]).Text;
那么RadioButtonList 控件怎么写法??
rad=e.item.findcontrol("sex")
response.write("<script>alert('选择的是" & rad.selectitem.value & "');</script>")看看是不是选择的值!
if(!IsPostback)
{
}
里面看看!
--------------------------------------------------------------------
你把这句放在updatecommand事件处理函数中,并且把绑定数据的语句放在
if(!IsPostback)
{
}
中