Click here to Skip to main content
13,052,669 members (64,078 online)
Rate this:
Please Sign up or sign in to vote.
See more:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
                    DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True">
                        <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                        <asp:BoundField DataField="Question" HeaderText="Question" SortExpression="Question" />
                                <asp:RadioButtonList AutoPostBack="true" ID="rbl" runat="server" Enabled="true" SelectedIndex='<%#Convert.ToInt32(DataBinder.Eval(Container.DataItem , "Discontinued"))%>'
                                    <asp:ListItem Value="0">No</asp:ListItem>
                                    <asp:ListItem Value="1">Yes</asp:ListItem>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:studentConnectionString %>"
                    SelectCommand="SELECT * FROM [AddQustSrvs] where [Category]='Food' and [UserId]= @userId "
                    UpdateCommand="UPDATE [AddQustSrvs] SET [Discontinued] = @Discontinued WHERE [id] = @id">
                        <asp:Parameter DefaultValue="'<%= userid %>'" Name="userId" DbType="String" />
                        <asp:Parameter Name="Discontinued" Type="Boolean" />
                        <asp:Parameter Name="id" Type="Int32" />

passing Value '<%=userid%>'

userid = Session["kill"].ToString(); code behind
Posted 18-Jun-12 2:57am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 18 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100