dealing with radiobuttonlist???

M

msn

I am trying to update my database with the code below, but I have a problem
it neither buton is selected???

<asp:radiobuttonlist id="BDec1" runat="server" RepeatDirection="Horizontal"
ForeColor="#1e60a2">
<asp:ListItem Value="y"></asp:ListItem>
<asp:ListItem Value="n"></asp:ListItem>
</asp:radiobuttonlist></td>

ContactInfoUpdate.UpdatePage11(userId, BDec1.SelectedItem.Value,........)

Public Function UpdatePage11(ByVal userId As Integer, ByVal BDec1 As String,
.............)

' Create Instance of Connection and Command Object
Dim myConnection As New
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim myCommand As New SqlCommand("UpdatePage11", myConnection)
' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure

Dim parameteruserId As New SqlParameter("@userId", SqlDbType.Int)
parameteruserId.Value = userId
myCommand.Parameters.Add(parameteruserId)

Dim parameterBDec1 As New SqlParameter("@BDec1", SqlDbType.Int)
parameterBDec1.Value = BDec1
myCommand.Parameters.Add(parameterBDec1)
 
C

CMA

in the design mode, set "Selected" property to true in one of the items. so
it will show u in the runnig mode. so u have a selected radio button and u
cannot unselect all.

hope this helps,
CMA
 

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

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top