<asp:Repeater ID="RepDetails" runat="server" > <HeaderTemplate> <table style=" border:1px solid #df5015; width:670px" cellpadding="0"> <tr style="background-color:#df5015; color:White; width:670px;"> <td colspan="2"> Searched Result </td> </tr> </HeaderTemplate> <itemtemplate> <tr> <td> CONTACT PERSON: <asp:Label ID="LblCntctPrsn" runat="server" Text='<%#Eval("CONTACTPRSN") %>'/> </td> </tr> <tr> <td> EMAIL ID: <asp:Label ID="LblEmail" runat="server" Text='<%#Eval("EMAILID") %>'/> </td> </tr> <tr> <td> <table style="background-color:#EBEFF0;border-removed1px dotted #df5015;border-removed1px solid #df5015; width:670px"> <tr> <td>Post Date:<asp:Label ID="lblDate" runat="server" Font-Bold="true" /></td> <td></td> </tr> </table> </td> </tr> <tr> <td colspan="2"> </td> </tr> </itemtemplate> <alternatingitemtemplate> <tr> <td> CONTACT PERSON: <asp:Label ID="LblCntctPrsn" runat="server" Text='<%#Eval("CONTACTPRSN") %>'/> </td> </tr> <tr> <td> EMAIL ID: <asp:Label ID="LblEmail" runat="server" Text='<%#Eval("EMAILID") %>'/> </td> </tr> <tr> <td> <table style="background-color:#EBEFF0;border-removed1px dotted #df5015;border-removed1px solid #df5015; width:670px"> <tr> <td>Post Date:<asp:Label ID="lblDate" runat="server" Font-Bold="true" /></td> <td></td> </tr> </table> </td> </tr> <tr> <td colspan="2"> </td> </tr> </alternatingitemtemplate> <footertemplate> </footertemplate></table>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class _Default : System.Web.UI.Page { SqlConnection conn = null; SqlCommand cmd = null; string con = ConfigurationManager.ConnectionStrings["Online1"].ConnectionString; protected void Page_Load(object sender, EventArgs e) { try { SqlConnection conn = new SqlConnection(con); SqlCommand chk = new SqlCommand("select CONTACTPRSN,EMAILID from EMPLYRSIGNUP ", conn); conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(chk); da.Fill(ds); RepDetails.DataSource = ds; RepDetails.DataBind(); } catch (Exception ex) { Label1.Text = ("Data Loading Failed" + ex.Message); } } }
<asp:repeater id="RepDetails" runat="server" > <HeaderTemplate> <table style="border: 1px solid #df5015; width: 670px" cellpadding="0"> <tr style="background-color: #df5015; color: White; width: 670px;"> <td colspan="2">Searched Result </td> </tr> </HeaderTemplate> <itemtemplate> <tr> <td>CONTACT PERSON: <asp:label id="LblCntctPrsn" runat="server" text="<%#Eval("CONTACTPRSN") %>" /> </td> </tr> <tr> <td>EMAIL ID: <asp:label id="LblEmail" runat="server" text="<%#Eval("EMAILID") %>" /> </td> </tr> <tr> <td> <table style="background-color: #EBEFF0; width: 670px"> <tr> <td>Post Date:<asp:label id="lblDate" runat="server" font-bold="true" /></td> <td></td> </tr> </table> </td> </tr> <tr> <td colspan="2"></td> </tr> </itemtemplate> </table></asp:repeater>
ds.Tables[0]
RepDetails.DataSource = ds;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)