I am trying to search entered records in the gridview but when i load the gridview the search option is not coming
please help
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FormsV2/Site1.Master" CodeBehind="RegisterInterview.aspx.vb" Inherits="SMIS2022WEB.RegisterInterview" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="../Scripts/Bootstrap3.3.2.css" />
<script type="text/javascript" src="../Scripts/Jquery1.9.1.min.js"></script>
<script type="text/javascript" src="../Scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="../Scripts/Jquery-3.5.1.js"></script>
<script type="text/javascript" src="../Scripts/Jquery.datatables.min.js"></script>
<script type="text/javascript" src="../Scripts/datatable.fixedColumns.min.js"></script>
<link href="../Scripts/Jquery.datatables.min.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/fixedColumns.dataTables.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.auto-style3 {
text-align: left;
width: 1110px;
}
.auto-style4 {
text-align: left;
width: 1110px;
height: 38px;
}
.auto-style5 {
text-align: left;
height: 34px;
}
.auto-style6 {
text-align: left;
height: 37px;
}
.auto-style7 {
text-align: left;
height: 38px;
}
.auto-style8 {
display: block;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table class="auto-style6">
<tr>
<td class="auto-style4"><strong>Class</strong></td>
<td class="auto-style4"><asp:DropDownList ID="Categoryddl1" runat="server" CssClass="auto-style8" AutoPostBack="true" Height="26px" Width="133px" >
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>TOP</asp:ListItem>
<asp:ListItem>MIDDLE</asp:ListItem>
<asp:ListItem>BABY</asp:ListItem>
<asp:ListItem>P1</asp:ListItem>
<asp:ListItem>P2</asp:ListItem>
<asp:ListItem>P3</asp:ListItem>
<asp:ListItem>P4</asp:ListItem>
<asp:ListItem>P5</asp:ListItem>
<asp:ListItem>P6</asp:ListItem>
<asp:ListItem>P7</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style4">Stream</td>
<td class="auto-style4"><asp:DropDownList ID="Streamdata" runat="server" CssClass="auto-style8" AutoPostBack="true" Height="28px" Width="133px" >
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>C</asp:ListItem>
<asp:ListItem>D</asp:ListItem>
<asp:ListItem>E</asp:ListItem>
<asp:ListItem>F</asp:ListItem>
<asp:ListItem>G</asp:ListItem>
<asp:ListItem>H</asp:ListItem>
<asp:ListItem>J</asp:ListItem>
<asp:ListItem>K</asp:ListItem>
<asp:ListItem>L</asp:ListItem>
<asp:ListItem>M</asp:ListItem>
<asp:ListItem>N</asp:ListItem>
<asp:ListItem>O</asp:ListItem>
<asp:ListItem>P</asp:ListItem>
<asp:ListItem>W</asp:ListItem>
<asp:ListItem>X</asp:ListItem>
<asp:ListItem>Y</asp:ListItem>
<asp:ListItem>Z</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style7">
</td>
</tr>
<tr>
<asp:GridView ID="GridView1" AutoGenerateColumns="False" runat="server"
CssClass="table table-bordered table-hover table-striped thead-dark GridCustomers" AllowPaging="True" Height="341px" Width="1110px" style="margin-left: 0px">
<Columns>
<asp:TemplateField HeaderText="admno">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("admno") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="admno" runat="server" Text='<%# Bind("admno") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="Names" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="Fname" runat="server" Text='<%# Bind("Name") %>' Width="211px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Name" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Class">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Class") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="ClassdllF" runat="server">
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>TOP</asp:ListItem>
<asp:ListItem>MIDDLE</asp:ListItem>
<asp:ListItem>BABY</asp:ListItem>
<asp:ListItem>P1</asp:ListItem>
<asp:ListItem>P2</asp:ListItem>
<asp:ListItem>P3</asp:ListItem>
<asp:ListItem>P4</asp:ListItem>
<asp:ListItem>P5</asp:ListItem>
<asp:ListItem>P6</asp:ListItem>
<asp:ListItem>P7</asp:ListItem>
</asp:DropDownList>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Class" runat="server" Text='<%# Bind("Class") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Stream">
<EditItemTemplate>
<asp:TextBox ID="Streamd" runat="server" Text='<%# Bind("Stream") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="Fstream" runat="server" Text='<%# Bind("Stream") %>'></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Stream" runat="server" Text='<%# Bind("Stream") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sex">
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Sex") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>NONE</asp:ListItem>
<asp:ListItem>MALE</asp:ListItem>
<asp:ListItem>FEMALE</asp:ListItem>
</asp:DropDownList>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Sex") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="House">
<EditItemTemplate>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("House") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("House") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Status" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<ItemTemplate>
<asp:LinkButton ID="lnkEdit" href="#" data-target="#MyPopup" data-toggle="modal"
runat="server">Edit</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Print ">
<ItemTemplate>
<asp:LinkButton ID="lnkBtnEdit" runat="server" Text="Print List" CssClass="btn btn-info"
OnClick="Display"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</tr>
</table>
<div id="MyPopup" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
×</button>
<h4 class="modal-title">
Print Class List</h4>
</div>
<div class="modal-body">
<table class="auto-style10">
<tr>
<td>
admno
</td>
<td>
<asp:TextBox runat="server" ID="admno" CssClass="form-control" />
</td>
<td class="auto-style5" colspan="2">
Name
</td>
<td>
<asp:TextBox runat="server" ID="txtName" CssClass="form-control" style="margin-left: 0px" Width="226px" />
</td>
</tr>
<tr>
<td>
Class</td>
<td>
<asp:TextBox runat="server" ID="txtCountry" CssClass="form-control" />
</td>
<td class="auto-style5" colspan="2">
Stream</td>
<td>
<asp:TextBox runat="server" ID="Stream" CssClass="form-control" style="margin-left: 0px" Width="226px" />
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="btnUpdate" Text="Print Class List" runat="server" CssClass="btn btn-primary"
OnClick="OnUpdate" />
<asp:Button ID="btnUpdate0" Text="Print Stream List" runat="server" CssClass="btn btn-primary"
OnClick="OnUpdate2007" />
<asp:Button ID="Button2" Text="Close" runat="server" CssClass="btn btn-danger"
OnClick="Displayclose" />
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#GridView1 tfoot tr').appendTo('#GridView1 thead');
$('#GridView1').removeAttr('width').DataTable({
bLengthChange: true,
lengthMenu: [[15, 20, -1], [15, 20, "All"]],
bFilter: true,
bSort: true,
scrollCollapse: true,
paging: true,
fixedColumns: false,
orderCellsTop: true
});
});
</script>
<script type="text/javascript">
$(function () {
$("[id*=lnkEdit]").click(function () {
$('[id*=admno]').val($(this).closest('tr').find('td').eq(0).html());
$('[id*=txtName]').val($(this).closest('tr').find('td').eq(1).html());
$('[id*=txtCountry]').val($(this).closest('tr').find('td').eq(2).html());
$('[id*=Stream]').val($(this).closest('tr').find('td').eq(3).html());
$('#MyPopup').modal('show');
return false;
});
});
</script>
<script type='text/javascript'>
function openModal() {
$('[id*=MyPopup]').modal('show');
}
</script>
</asp:Content>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim constr As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand("SELECT admno,name,class,stream,Status,SEX,House FROM P3P7 where ISNULL(Status,'') = '' and class is not null and stream is not null", con)
Using sda As New SqlDataAdapter(cmd)
cmd.CommandType = CommandType.Text
Dim dt As New DataTable()
sda.Fill(dt)
GridView1.DataSource = dt
GridView1.DataBind()
GridView1.UseAccessibleHeader = True
GridView1.HeaderRow.TableSection = TableRowSection.TableHeader
End Using
End Using
End Using
End If
End Sub