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="SqlDataSourc e3" 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:RequiredFieldValidato r runat="server" ControlToValidate = "TextBox1" ErrorMessage="RequiredFiel dValidator ">
</asp:RequiredFieldValidat or>
</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, @radiobuttonselectionvalue type)">
radiobuttonselectionvalue = "1" or "0" default=0
HELP and thank you
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="SqlDataSourc
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:RequiredFieldValidato
</asp:RequiredFieldValidat
</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, @radiobuttonselectionvalue
radiobuttonselectionvalue = "1" or "0" default=0
HELP and thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.