Guest User

Untitled

a guest
Jun 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" AllowSorting="True">
  2. <AlternatingRowStyle BackColor="White" />
  3. <Columns>
  4. <asp:CommandField ShowEditButton="True" />
  5. <asp:TemplateField HeaderText="id" InsertVisible="False" SortExpression="id">
  6. <EditItemTemplate>
  7. <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
  8. </EditItemTemplate>
  9. <ItemTemplate>
  10. <asp:Label ID="Label1" runat="server" Text='<%# Bind("id") %>'></asp:Label>
  11. </ItemTemplate>
  12. </asp:TemplateField>
  13. <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
  14. <asp:BoundField DataField="E-mail" HeaderText="E-mail" SortExpression="E-mail" />
  15. </Columns>
  16. <EditRowStyle BackColor="#2461BF" />
  17. <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
  18. <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  19. <PagerStyle ForeColor="White" HorizontalAlign="Center" BackColor="#2461BF" />
  20. <RowStyle BackColor="#EFF3FB" />
  21. <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  22. <SortedAscendingCellStyle BackColor="#F5F7FB" />
  23. <SortedAscendingHeaderStyle BackColor="#6D95E1" />
  24. <SortedDescendingCellStyle BackColor="#E9EBEF" />
  25. <SortedDescendingHeaderStyle BackColor="#4870BE" />
  26. </asp:GridView>
  27. <asp:SqlDataSource ID="SqlDataSource2" runat="server"
  28. ConnectionString="<%$ ConnectionStrings:demoConnectionString4 %>"
  29. SelectCommand="SELECT * FROM [de]"
  30. UpdateCommand="UPDATE [de] SET [Name]=@Name, [E-mail]=@column1 WHERE [id]=@id">
  31. <UpdateParameters>
  32. <asp:Parameter Name="id" Type="Int32" />
  33. <asp:Parameter Name="Name" Type="String"/>
  34. <asp:Parameter Name="column1" Type="String"/>
  35. </UpdateParameters>
  36. </asp:SqlDataSource>
Add Comment
Please, Sign In to add comment