NET 2.0 C# DetailsView RadioButtonList how set  parmete

Posted on 2006-05-12
Medium Priority
Last Modified: 2008-02-23
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>
  <form id="form1" runat="server">
    <asp:DetailsView DefaultMode="Insert" AutoGenerateRows="False" DataKeyNames="au_id"
      DataSourceID="SqlDataSource3" HeaderText="Insert Author" ID="DetailsView1" runat="server"
        <asp:BoundField DataField="firstname" HeaderText="au_id" ReadOnly="True" SortExpression="au_id" />

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

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

   <asp:CommandField ShowInsertButton="True" />
    <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
Question by:RSSIAdmin
1 Comment
LVL 11

Accepted Solution

TornadoV earned 2000 total points
ID: 16668968
Here is a great article:


This will help with your databinding

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question