I have write function but it's not working.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="cni.index" %>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<link href="js/jquery-ui.min.css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/1.10.9/css/dataTables.bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/responsive/1.0.7/css/responsive.bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<!DOCTYPE html>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Material Register C&I Lab</title>
<style type="text/css">
.auto-style1 { background-color: #003366; }
.auto-style2 { background-color: #FFFFFF; }
</style>
</head>
<body bg color="red">
<form id="form1" runat="server" defaultbutton="Button_check1">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="container mt-3">
<h2>
<table border="1" class="auto-style1">
<tr>
<td class="auto-style2" colspan="10">
<table cellpadding="0" cellspacing="0" style="box-sizing: inherit; margin: 0px auto 0px 0px; padding: 0px; width: 1155px; max-width: 1260px; color: rgb(0, 0, 0); font-family: Roboto; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; height: 28px;">
<tbody style="box-sizing: inherit; margin: 0px; padding: 0px;">
<tr style="box-sizing: inherit; margin: 0px; padding: 0px;">
<td class="auto-style2" style="box-sizing: inherit; margin: 0px; padding: 0px 10px; vertical-align: top;"><a href="http://10.1.246.41/intranet/Default.aspx" style="box-sizing: inherit; margin: 0px; padding: 0px; display: inline-block; text-decoration: none; transition: all 0.3s ease 0s;">
<img alt="munpl-logo" class="auto-style1" src="http://10.1.246.41/intranet/images/munpl-logo.jpg" style="box-sizing: inherit; margin: 0px; padding: 0px; max-width: 100%; width: 87px; height: 89px;" /></a></td>
<td class="auto-style2" style="box-sizing: inherit; margin: 0px; padding: 10px 0px 0px; vertical-align: top;"><span class="project" style="box-sizing: inherit; margin: 0px; padding: 0px 0px 10px; font-weight: 700; font-size: 28px; line-height: 40px; background-repeat: no-repeat; background-size: 100%; background-position: center bottom; display: inline-block; color: rgb(21, 101, 178);">
<div class="text-center" style="width: 997px; margin-left: 0px; height: 34px;">
<span id="WCTopBar_lblProjectName" style="box-sizing: inherit; margin: 0px; padding: 0px;">Meja Thermal Power Plant</span>
</div>
</span>
<div class="text-center" style="box-sizing: inherit; margin: 0px 0px 0px 49px; padding: 5px 0px 20px; font-weight: 500; color: rgb(0, 0, 0); font-style: italic; font-size: 15px; min-height: 35px; width: 880px; height: 4px;">
<span id="WCTopBar_lblProjectDescription" style="box-sizing: inherit; margin: 0px; padding: 0px;">A Joint Venture of NTPC Ltd & UPRVUNL</span>
</div>
<div class="auto-style70" align="right">
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" align="right" OnClick="LinkButton1_Click">LogOut</asp:LinkButton>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</h2>
<h5><span class="auto-style78"> Welcome
</span>
<asp:Label ID="Label2" runat="server" CssClass="auto-style62" Style="color: #003366; text-decoration: underline;"></asp:Label>
,<span class="auto-style78"><asp:Label ID="Label1" runat="server" CssClass="auto-style62" Style="color: #003366; text-decoration: underline;"></asp:Label> ,
<asp:Label ID="Label3" runat="server" CssClass="auto-style62" Style="color: #003366; text-decoration: underline;"></asp:Label>
,<asp:Label ID="Label4" runat="server" CssClass="auto-style62" Style="color: #003366; text-decoration: underline;"></asp:Label>
,
<asp:Label ID="Label5" runat="server" CssClass="auto-style66" Style="color: #003366; text-decoration: underline;"></asp:Label>
</h5>
<br>
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu0">Material Deposit</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu1">Material Issue</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu2">Consumable Issue </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu3">Tools Issue </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu4">Change Password</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu5">Stocks & Meterial</a>
</li>
</ul>
<div id="menu0" class="container tab-pane fade">
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" DefaultButton="Button1">
<ContentTemplate>
<table border="1">
<tr>
<td class="auto-style74"><span style="box-sizing: border-box; font-family: sourcesanspro-regular; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(255, 0, 0);">
<span id="ContentPlaceHolder1_Label13" style="box-sizing: border-box; color: rgb(0, 0, 0); font-family: sourcesanspro-regular; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" class="auto-style74">Material code</span><span style="color: rgb(0, 0, 0); font-family: sourcesanspro-regular; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none; background-color: rgb(255, 255, 255)" class="auto-style74"> </span></span><span style="box-sizing: border-box; font-family: sourcesanspro-regular; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(255, 0, 0);" class="auto-style74"><span style="box-sizing: border-box; font-family: sourcesanspro-regular; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(255, 0, 0);">:</span></span></td>
<td class="auto-style3" colspan="4">
<asp:TextBox ID="txt_Mtrl_cd" runat="server"></asp:TextBox><img src="images/images/seachr.png" height="30px" width="30px" data-toggle="modal" data-target="#myModal" />
<div class="modal fade" id="myModal" 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">Mtrl descrption</h4>
</div>
<div class="modal-body">
<asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="False" class="table table-striped">
<AlternatingRowStyle BackColor="#F7F7F7" />
<Columns>
<asp:BoundField DataField="Mtrl_cd" HeaderText="Mtrl_cd" />
<asp:BoundField DataField="Mtrl_dscrptn" HeaderText="Mtrl_dscrptn" />
</Columns>
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<SortedAscendingCellStyle BackColor="#F4F4FD" />
<SortedAscendingHeaderStyle BackColor="#5A4C9D" />
<SortedDescendingCellStyle BackColor="#D8D8F0" />
<SortedDescendingHeaderStyle BackColor="#3E3277" />
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
if (!this.IsPostBack)
{
string constr = ConfigurationManager.ConnectionStrings["IntranetConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
{
using (SqlCommand cmd = new SqlCommand("SELECT Mtrl_cd,Mtrl_dscrptn FROM mtrl_mstr", con))
{
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
cmd.CommandType = CommandType.Text;
DataTable dt = new DataTable();
sda.Fill(dt);
gvCustomers.DataSource = dt;
gvCustomers.DataBind();
}
}
}
}
}