So i am currently trying to to a textbox with an image inside, and i have the method onclick to enter my event of button_clink in c# but its not working
<div class="input-container">
<input type="text" id="txtSearch" runat="server" class="input-field" style="color: black;" placeholder="Pesquisar.."/>
<button id="btnsearch" class="wrapper" OnClick="btnsearch_Click" runat="server"><i class="fas fa-search" style="color:#8b9095;" ></i></button>
</div>
c# Code:
protected void btnsearch_Click(object sender, EventArgs e)
{
con.Open();
var txtSearch = FindControl("txtSearch") as TextBox;
SqlCommand cmd = new SqlCommand("select DISTINCT from [encomenda] where No_= " + txtSearch + "", con);
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())
{
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
con.Close();
}