Click here to Skip to main content
12,403,812 members (72,382 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
<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" />

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
Web02 | 2.8.160721.1 | Last Updated 18 Jun 2012
Copyright © CodeProject, 1999-2016
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