RadioButtonList and Selected


G

Guest

I have a radiobuttonlist like so

<asp:RadioButtonList id=radType RepeatDirection="Horizontal" cellpadding="10" cellspacing="0" runat="server"><asp:ListItem value="Something1"><font face="arial,helvetica" size="2">Something 1</font></asp:ListItem><asp:ListItem value="Something2"><font face="arial,helvetica" size="2">Something 2</font></asp:ListItem><asp:ListItem value="Something3"><font face="arial,helvetica" size="2">Something 3</font></asp:ListItem><asp:ListItem value="Something4"><font face="arial,helvetica" size="2">Something 4</font></asp:ListItem></asp:RadioButtonList

The selected value of the radType is saved to a table

When opening the page, I am using a datareader to read a row in a table, I then need to make one of the items in the list selected based on what is in the table row. Eg

Dim DBConnection As SQLConnectio
Dim DBCommand As SQLComman
Dim DBReader As SQLDataReade
Dim SQLString As Strin
DBConnection = New SQLConnection("connection string here"
DBConnection.Open(
SQLString = "SELECT * from table1 where uid='" & request("uid") & "'
DBCommand = New SQLCommand(SQLString, DBConnection
DBReader = DBCommand.ExecuteReader(
DBReader.rea
radJobType.selectedvalue=DBReader("type")
DBReader.Close(
DBConnection.Close(

This doesn't seem to work. How can I make the item in the radiobuttonlist selected based on the value in the row

Thanks
 
Ad

Advertisements

A

Alvin Bruney [MVP]

Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Jay said:
I have a radiobuttonlist like so:

<asp:RadioButtonList id=radType RepeatDirection="Horizontal"
cellpadding="10" cellspacing="0" runat="server"><asp:ListItem
value="Something1"><font face="arial,helvetica" size="2">Something
1</font></asp:ListItem><asp:ListItem value="Something2"><font
face="arial,helvetica" size="2">Something
2</font></asp:ListItem><asp:ListItem value="Something3"><font
face="arial,helvetica" size="2">Something
3</font></asp:ListItem><asp:ListItem value="Something4"><font
face="arial,helvetica" size="2">Something
4 said:
The selected value of the radType is saved to a table.


When opening the page, I am using a datareader to read a row in a table, I
then need to make one of the items in the list selected based on what is in
the table row. Eg.
Dim DBConnection As SQLConnection
Dim DBCommand As SQLCommand
Dim DBReader As SQLDataReader
Dim SQLString As String
DBConnection = New SQLConnection("connection string here")
DBConnection.Open()
SQLString = "SELECT * from table1 where uid='" & request("uid") & "'"
DBCommand = New SQLCommand(SQLString, DBConnection)
DBReader = DBCommand.ExecuteReader()
DBReader.read
radJobType.selectedvalue=DBReader("type")
DBReader.Close()
DBConnection.Close()

This doesn't seem to work. How can I make the item in the radiobuttonlist
selected based on the value in the row?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top