Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my problem is that if user enter the date ,from year of date next drop down field enlist the entries of that year in the list from the database table.
Posted
Comments
Nelek 27-Aug-14 19:48pm    
I don't know the others, but I can not understand what you say. Would you mind to explain it a bit better?
Sajid227 27-Aug-14 20:27pm    
THERE are two field at front end date is independent field but drop down is depend on the value of date entered,if user enter of any year from 2009 upto now,the dropdown must update itself accordingly,how can i do that
ChauhanAjay 27-Aug-14 21:19pm    
Check this link
http://www.codeproject.com/Questions/812384/when-date-is-change-in-the-field-then-drop-down-wi?arn=1

Try to use texboxchanged event
Givina a example following below
design
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"
           ontextchanged="TextBox1_TextChanged"></asp:TextBox>

COde
C#
protected void txtProduct_TextChanged(object sender, EventArgs e)
{
if (txtProduct.Text != "")
{
string strSQL = "make your sql query ;  
 
DataTable dt =Commanclass.returnData(strSQL);//return (DataTable) with yourdata
DropdownList1.DataSource = dt;
DropdownList1.DataTextField = "Name";
DropdownList1.DataValueField = "Name";
DropdownList1.DataBind();
 }
}
 
Share this answer
 
v2
You can manage it will Text Change event... on text change you have to rebind dropdownlist with filtered data.
 
Share this answer
 
Comments
Sajid227 28-Aug-14 3:47am    
bro will u send a demo code so that i can implement it,for my requirment

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900