<asp:DataList ID="datalist1" style=" margin-left:5px; text-align:left" runat="server" Width="996px" CellPadding="4" ForeColor="#333333" Height="228px"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <AlternatingItemStyle BackColor="White" ForeColor="#284775" /> <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" /> <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderTemplate> <asp:Label ID="uname" style="width:150px; font-weight:bold; margin-left:20px;" runat="server" Text="User Name" ></asp:Label> <asp:Label ID="cname" style="width:150px;font-weight:bold; margin-left:20px;" runat="server" Text="Company Name" ></asp:Label> <asp:Label ID="contact" style="width:150px;font-weight:bold; margin-left:20px;" runat="server" Text="Conatct Number" ></asp:Label> <asp:Label ID="Label1" style="width:150px;font-weight:bold; margin-left:40px;" runat="server" Text="Email" ></asp:Label> <asp:Label ID="Address" style="width:150px;font-weight:bold; margin-left:100px;" runat="server" Text="Address"></asp:Label> <asp:Label ID="status" style="width:150px;font-weight:bold; margin-left:100px;" runat="server" Text="Status"></asp:Label> </HeaderTemplate> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <ItemTemplate> <asp:Label ID="uname" style="width:100px;margin-left:30px;" runat="server" Text='<%#Eval("uid") %>' ></asp:Label> <asp:Label ID="cname" style="width:100px; margin-left:30px;" runat="server" Text='<%#Eval("cname") %>' ></asp:Label> <asp:Label ID="contact" style="width:100px;margin-left:50px;" runat="server" Text='<%#Eval("Contact") %>' ></asp:Label> <asp:Label ID="Label2" style="width:100px;margin-left:80px; " runat="server" Text='<%#Eval("email") %>' ></asp:Label> <asp:Label ID="Address" style="width:100px;margin-left:70px; height:100px;" runat="server" Text='<%#Eval("address") %>'></asp:Label> <asp:Label ID="status" style="width:150px; margin-left:80px;" runat="server" Text='<%#Eval("status") %>'></asp:Label> <asp:CheckBox ID="CheckBox1" style="margin-left:10px;" runat="server" /> <asp:LinkButton ID="LinkButton1" style="margin-left:10px;" runat="server" Text="Change status" CommandName="change"></asp:LinkButton> <asp:LinkButton ID="LinkButton2" style="margin-left:10px;" runat="server" Text="Delete" CommandName="del"></asp:LinkButton> </ItemTemplate> </asp:DataList>
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Web.Configuration; public partial class admin : System.Web.UI.Page { string con = WebConfigurationManager.ConnectionStrings["connection"].ToString(); protected void Page_Load(object sender, EventArgs e) { bind(); } public void bind() { SqlDataAdapter da = new SqlDataAdapter("select *from reg",con); DataSet ds=new DataSet(); da.Fill(ds); datalist1.DataSource = ds; datalist1.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)