首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

读取状态

2011-12-21 
读取状态?aspx代码页:asp:radiobuttonlistid RadioButtonList1 runat server RepeatDirection Ho

读取状态?
aspx代码页:
<asp:radiobuttonlist   id= "RadioButtonList1 "   runat= "server "   RepeatDirection= "Horizontal ">
<asp:ListItem   Value= "1 "> 是 </asp:ListItem>
<asp:ListItem   Value= "0 "> 否 </asp:ListItem>
</asp:radiobuttonlist>
在aspx.cs里头如何根据等于1的情况就选择“是”,0的情况就选择“否”呢?

if(ds.Tables[0].Rows[0][ "IsVisable "].ToString()== "1 ")
{
    ??
}
else
{
    ??
}

请指教!谢谢!

[解决办法]
if(ds.Tables[0].Rows[0][ "IsVisable "].ToString()== "1 ")
{
RadioButtonList1.SelectedValue = "1 ";
}
else
{
RadioButtonList1.SelectedValue = "0 ";
}

热点排行