Hi,
I am driving nuts with what it supposed to be a very simple thing:
I have a datalist which pulls out some data from sql server and inside my datalist I have a radiobuttonlist.
<ASPataList id="MyDataList" runat="server" AutoGenerateColumns="false" OnUpdateCommand="Update_Command">
First Name: <%# DataBinder.Eval(Container.DataItem, "usrFirstName") %>
...
<asp:RadioButtonList class="normal" id="radiostatus" runat="server">
<asp:ListItem Value="1">Enable</asp:ListItem>
<asp:ListItem Value="2">Disable</asp:ListItem>
</asp:RadioButtonList>
What I am trying to do is the following; if the value I have on the database (field Name = usrStatus) is 1, then make the <asp:ListItem Value="1" SELECTED>Enable</asp:ListItem> and if the value is 2 then select by default the option Disable. This supposed to be a simple thing to do but I guess its right to assume that the simple stuff is sometimes the most difficult
I hope someone knows the answer to my problem.
thanks a lot
I am driving nuts with what it supposed to be a very simple thing:
I have a datalist which pulls out some data from sql server and inside my datalist I have a radiobuttonlist.
<ASPataList id="MyDataList" runat="server" AutoGenerateColumns="false" OnUpdateCommand="Update_Command">
First Name: <%# DataBinder.Eval(Container.DataItem, "usrFirstName") %>
...
<asp:RadioButtonList class="normal" id="radiostatus" runat="server">
<asp:ListItem Value="1">Enable</asp:ListItem>
<asp:ListItem Value="2">Disable</asp:ListItem>
</asp:RadioButtonList>
What I am trying to do is the following; if the value I have on the database (field Name = usrStatus) is 1, then make the <asp:ListItem Value="1" SELECTED>Enable</asp:ListItem> and if the value is 2 then select by default the option Disable. This supposed to be a simple thing to do but I guess its right to assume that the simple stuff is sometimes the most difficult
I hope someone knows the answer to my problem.
thanks a lot