Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit RadioButtonList HELP

Status
Not open for further replies.

sonya9879

Programmer
Jun 18, 2004
147
CA
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.

<ASP:DataList 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 posted that in the VB.NET because i use VB.NET
 
errr, I can use TextPad to write Java, but their website wouldn't have much for programing help.

Are you generating an ASP.Net (aspx) file from within a VB.Net application? Or are you using the Visual Studio interface to write an ASP.Net document?

If you are generating the code from a VB.Net application, it shouldn't be hard, check the value and output the text accordingly. If you are writing an ASP.Net document, I would again suggest posting on the ASP.Net forum.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top