Click here to Skip to main content
11,789,710 members (61,071 online)
Rate this: bad
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
0 OriginalGriff 999
1 Maciej Los 765
2 KrunalRohit 686
3 CPallini 606
4 Richard MacCutchan 430

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.1 | Last Updated 18 Jun 2012
Copyright © CodeProject, 1999-2015
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