| | |
Combo Box and ASP.net
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
Hi
I have dropdown list in my asp.net page.I wrote a below coing coidng in the SelectedIndexChanged,
protected void cmb_Se_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con=new SqlConnection("Data Source=20.1.2.58;Initial Catalog=Customer;User ID=test123");
string str = "select ExecutiveName from Executive where TeCode='"+cmb_Te.Text+"'";
con.Open();
SqlCommand command=new SqlCommand(str,con);
SqlDataAdapter adpter=new SqlDataAdapter(command);
DataSet data=new DataSet();
adpter.Fill(data);
int i= data.Tables[0].Rows.Count;
for (int x = 0; i < i; i++)
{
cmb_Se.Items.Add(data.Tables[0].Rows[x].ToString());
}
}
I mention what is code i wrote in my page,But once i select the text from cmb_Te combo box,the below combo box in not change.Pls give me a answer.
Thank you
I have dropdown list in my asp.net page.I wrote a below coing coidng in the SelectedIndexChanged,
protected void cmb_Se_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con=new SqlConnection("Data Source=20.1.2.58;Initial Catalog=Customer;User ID=test123");
string str = "select ExecutiveName from Executive where TeCode='"+cmb_Te.Text+"'";
con.Open();
SqlCommand command=new SqlCommand(str,con);
SqlDataAdapter adpter=new SqlDataAdapter(command);
DataSet data=new DataSet();
adpter.Fill(data);
int i= data.Tables[0].Rows.Count;
for (int x = 0; i < i; i++)
{
cmb_Se.Items.Add(data.Tables[0].Rows[x].ToString());
}
}
I mention what is code i wrote in my page,But once i select the text from cmb_Te combo box,the below combo box in not change.Pls give me a answer.
Thank you
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
Add more infor for Form submit.
AutoPostBack="True"
AutoPostBack="True"
asp.net Syntax (Toggle Plain Text)
<asp:DropDownList ID="ddl_Select" runat="server" Width="103px" OnSelectedIndexChanged="ddl_Select_SelectedIndexChanged" OnTextChanged="ddl_Select_TextChanged" [B]AutoPostBack="True"[/B]> </asp:DropDownList>
Last edited by peter_budo; Dec 29th, 2008 at 11:28 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- Tutorial: Understanding ASP classes (ASP)
- Problem with ASP.Net control or JavaScript ??? (ASP.NET)
- How To Hyperlink Normal HTML page with ASP.NET Page? (ASP.NET)
- VB .Net Enterprise Edition (VB.NET)
- Editable combo (HTML and CSS)
- nobody answers my questions (C#)
- how to insert a combo box in c# data grid (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: Problem with sessions please help
- Next Thread: Migrating from VB6 to ASP.Net from scratch
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# cac checkbox class commonfunctions contenttype countryselector dataaccesslayer database datagrid datagridview datagridviewcheckbox deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal formview gridview gudi iframe iis javascript listbox menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news novell opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail rotatepage schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio vs2008 web webapplications webarchitecture webdevelopemnt webdevelopment webprogramming webservice youareanotmemberofthedebuggerusers





