?
Solved

NET 2.0 C# DetailsView RadioButtonList how set  parmete

Posted on 2006-05-12
1
Medium Priority
?
3,626 Views
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>
</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
0
Comment
Question by:RSSIAdmin
1 Comment
 
LVL 11

Accepted Solution

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

http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET06/aspnet06-03.aspx

This will help with your databinding
0

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