How To show Data On Repeater Tool and Customize Search data

How To show Data On Repeater Tool and Customize Search data

Repeater Tools is a power full controls tool  in asp.net .we have using this tool to cool or free mind and its adjust in a any type formats like mobile web view so its a power full control to show data on the web site and searching in major part of every web site to cover the all field of  access the web site
data .its using the best technique for this .

Out Put ...........................................................................................................................................

---------------------------------------------------end out put----------------------------------------------------------
Code HTML

Its HTML Code --------------------

 <script type="text/javascript">
        $(document).ready(function () {
            $('#tableCustomer').dataTable();
        });
    </script>
    <!-- Breadcrumbs line -->
<div class="breadcrumb-line">
<ul class="breadcrumb">
<li><a href="Welcome_Page.aspx">Home</a></li>
<li class="active">Show Employee List</li>
</ul>
</div>


  <div class="panel panel-default">
               <div class="panel-heading"><h6 class="panel-title"><i class="icon-insert-template"></i>Show Employee</h6></div>
               <div class="table-responsive">
       <asp:Repeater ID="rptrCustomer" runat="server">
            <HeaderTemplate>
                <table id="tableCustomer" class="table display">
                    <thead>
                        <tr>
                            <th>Action</th>
<th>Photo</th>
           <th>Name</th>                                             
<th>Department</th>
           <th>Designation</th>
                            <th>Landline No.</th>
           <th>Extension No.</th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                <td><a href="Your Page.aspx?id=<%#DataBinder.Eval(Container.DataItem,"id")%>"><img src="images/view1.png"  width="25px" height="30px" alt="View" /></a></td>
                <td><a href="Your Page.aspx?id=<%#DataBinder.Eval(Container.DataItem,"id")%>"><img src="<%# DataBinder.Eval(Container.DataItem,"image")%>" alt="image" width="60px" height="60px" /></a>                  
                        <%--<%# DataBinder.Eval(Container.DataItem, "image")%>--%>
                    </td>
                <td><%# DataBinder.Eval(Container.DataItem, "emppre")%>. <%# DataBinder.Eval(Container.DataItem, "empfname")%></td>
                <td><%# DataBinder.Eval(Container.DataItem, "empdepart")%></td>
                <td><%# DataBinder.Eval(Container.DataItem, "empdesign")%></td>
                <td><a href="#"><%# DataBinder.Eval(Container.DataItem, "empimage")%></a></td>
                <td><%# DataBinder.Eval(Container.DataItem, "empuaeext")%></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
     </div>
     </div>



-------------------------------------------- C# Asp.net Code ---------------------------------



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
 protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["empid"] == null || Session["empid"].ToString().Equals(""))
        {
          
        }


        string connection=ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection com = new SqlConnection(connection);
        string query = "SELECT * FROM emptable where status='Active' order by empfname asc";
        SqlDataAdapter sda = new SqlDataAdapter(query, com);
        DataTable dtCustomers = new DataTable();
        sda.Fill(dtCustomers);
        rptrCustomer.DataSource = dtCustomers;
        rptrCustomer.DataBind();
       
      
    }
}
------------------------------------------Data Base Table Scripts ---------------------------------------


CREATE TABLE [dbo].[emptable](
[id] [int] IDENTITY(1,1) NOT NULL,
[empid] [nvarchar](50) NULL,
[emppre] [nvarchar](50) NULL,
[empfname] [nvarchar](max) NULL,
[emplname] [nvarchar](max) NULL,
[empcountry] [nvarchar](50) NULL,
[empstate] [nvarchar](50) NULL,
[empcity] [nvarchar](50) NULL,
[empaddline] [nvarchar](50) NULL,
[empzipcode] [nvarchar](50) NULL,
[empcontact] [nvarchar](50) NULL,
[empemail] [nvarchar](max) NULL,
[empyear] [nvarchar](50) NULL,
[password] [nvarchar](50) NULL,
[empdepart] [nvarchar](max) NULL,
[empdesign] [nvarchar](max) NULL,
[usertype] [nvarchar](max) NULL,
[type] [nvarchar](max) NULL,
[empsalary] [nvarchar](max) NULL,
[empjdate] [nvarchar](max) NULL,
[empimage] [nvarchar](max) NULL,
  [status] [nvarchar](50) NULL,
[image] [nvarchar](max) NULL,
  [empdepartar] [nvarchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]




-------------------------------------------------------end of the sripts --------------------------
web configration

    <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;database=emsDB ;Integrated Security=True" providerName="System.Data.SqlClient" />


Post a Comment

Previous Post Next Post

Design a beautiful Login/Signup (with google map) in Flutter | Flutter UI | VS Code | iOS Android