Link to home
Start Free TrialLog in
Avatar of RSSIAdmin
RSSIAdmin

asked on

NET 2.0 C# DetailsView RadioButtonList how set parmete

Hi Expert:

Could someone  kindly please show me how to set a RadioButtonList selected value  into the InsertCommand="INSERT INTO      show below

I am the using the "DetailsView" Insert mode something like show below:

   <title>DetailsView Insert</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:DetailsView DefaultMode="Insert" AutoGenerateRows="False" DataKeyNames="au_id"
      DataSourceID="SqlDataSource3" HeaderText="Insert Author" ID="DetailsView1" runat="server"
      Width="275px"
      DefaultMode=Insert">
      <Fields>
        <asp:BoundField DataField="firstname" HeaderText="au_id" ReadOnly="True" SortExpression="au_id" />

        <EditItemTemplate>
    <asp:TextBox ID="TextBox1" runat="server"  Text='<%# Bind("firstname") %>'></asp:TextBox>
    <asp:RequiredFieldValidator runat="server" ControlToValidate = "TextBox1" ErrorMessage="RequiredFieldValidator">
    </asp:RequiredFieldValidator>
</EditItemTemplate>

        <EditItemTemplate>
    <asp:RadioButtonList  id ="RadioButtonList1" RepeartLayout= Flow runat="server"  ???='<%# Bind("type ") %>'></asp:RadioButtonList  >
    </EditItemTemplate>


   <asp:CommandField ShowInsertButton="True" />
      </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Pubs %>"
     
   InsertCommand="INSERT INTO persons (firstname, type ) VALUES (@firstname, @radiobuttonselectionvaluetype)">
       
radiobuttonselectionvalue = "1"   or "0"              default=0


HELP and thank you
ASKER CERTIFIED SOLUTION
Avatar of TornadoV
TornadoV
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial