HI
<tr>
<td>
<asp:Label ID="lblsearch" runat="server" Text="Search" Width="80px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtsearch" runat="server" CssClass="txtbox" OnTextChanged="txtsearch_TextChanged" AutoPostBack="true"></asp:TextBox>
</td>
<td>
<asp:ImageButton ID="btnsearch" runat="server" ImageUrl="~/images/gnome-searchtool.png"
Width="25px" Height="25px" />
</td>
</tr>
Here btnserach acts like a calendar control(so that i can select,today,after 1 week,before day....) options.after selecting the day i need to search for the record based on the selection,i wrote a code in txtsearch_textchanged event,but not getting fired.how to do write and in which event i should write code
protected void txtsearch_TextChanged(object sender, EventArgs e)
{
try
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings[""].ToString();
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("SELECT distinct ApplicantID,DataSourceId,ApplicantName,r.ContactNumber,AlternateContactNumber,r.Gender,EmailId, CountryIntersted,OtherCountryName,r.EmployeeId, FollowUpId,BranchId,AppointmentDate,AppointmentTime,Comments,r.Description,r.EntryBY,r.CreatedDate,r.ModifiedDate, e.FirstName +' '+e.LastName as EntryName FROM RCNewApplicants r,EmployeePersonalDetails e where r.EntryBY=e.EmployeeId and r.CreatedDate=" + txtsearch.Text, conn);
DataSet ds = new DataSet();
da.Fill(ds);
gvnotassigned.DataSource = ds;
gvnotassigned.DataBind();
}
catch (Exception ex)
{
ex.Message.ToString();
}
}
vijaya
Vijayar, if this helps please login to Mark As Answer. | Alert Moderator