I want to make a search textbox like this:
http://www.freeimagehosting.net/65b24
But, I don't know how. Any help is appreciated. Thank you.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manoj SevdaPosted Nov 12, 2011, 5:39 AM
Try with telerik control, mostly Telerik dropdownlist.
nishant ranjanPosted Nov 12, 2011, 5:06 AM
nishant ranjanPosted Nov 12, 2011, 5:04 AM
{
string qry = "";
qry = string.Format("select * from TABLE NAME where 1=1");
if (txt_name.Text != "")
{
qry = qry + "and name='" + txt_name.Text + "'";
}
// bind the grid view, if want to show search result in grid view or where ever you want
sql_detail.SelectCommand = qry;
gv_detail.DataBind();
if (gv_detail.Rows.Count > 0)
{
lbl_msg.Text = "";
lbl_msg.Visible = false;
}
else
{
lbl_msg.Text = "No Matching Result Found";
lbl_msg.Visible = true;
}
}
catch (Exception ex)
{
lbl_exception = Master.FindControl("lbl_Exception") as Label;
lbl_exception.Text = ex.Message;
}
in design side
make a textbox and a button and above code should be in click event of that button
try out