Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have a situation when user select value from 1st dropdownlist then item in 2nd dropdown list appear according to the selected value from the first.lastly the form will appear after value in 2nd dropdown is selected.

my problem is whenever user finish select the 2nd dropdown, the 2nd dropdown is dissapear but the form is there.

help me.i have to submit this project asap :(

thanx
Posted
Updated 12-Dec-11 5:50am
v2
Comments
koolprasad2003 12-Dec-11 6:55am    
please show use the code (aspx and code behind)
[no name] 12-Dec-11 6:56am    
How are you handling the selection and display of form?
S.P.Tiwari 12-Dec-11 7:08am    
need to see your code.
KiranBabu M 12-Dec-11 7:27am    
can u Post your code?
[no name] 12-Dec-11 11:57am    
Give Your Code

When page_load fire on page after any event then dropdownlist2 is not visible. so check through condition under :
C#
 protected void Page_Load(object sender, EventArgs e)
    {
if (dropdownlist2.SelectedIndex!=0)
     dropdownlist2.visible=true;
else
     dropdownlist2.visible=false;

}


go through this. Hope this will help you.
Don't forget to mark as answer if it helps. :)
 
Share this answer
 
Comments
musiw 12-Dec-11 21:40pm    
hi manish...

i already try your code.it visibles.not dissapear as earlier.but now one problem is....the item in the dropdown turn empty.only the dropdown shows there... hihi
It looks like you are hiding the dropdown2 on by default (may be on page_load) and show the dropdown2 when user selects an item in dropdown1.

Check whether you have the code to hide the dropdown2 in pageload but outof if(!IsPostBack){}.

Share your code to get the appropiate solution.
 
Share this answer
 
As you didn't provide your code it is very difficult to identify where is your problem. I am providing you some nice links for your better understanding what you need to do. Please go through the following links:

CascadingDropDown Demonstration
Using CascadingDropDown with a Database
Populate Cascading DropDownList based on selection of other dropdown ASP.NET
how to populate dropdown based on other dropdown or working with cascading dropdowns in asp.net
Ajax Cascading Dropdownlist Sample with database using asp.net

Every single link will guide you to implement Cascading DropDown.
 
Share this answer
 
Comments
RaviRanjanKr 12-Dec-11 12:13pm    
My 5!
Monjurul Habib 12-Dec-11 12:24pm    
thank you
musiw 15-Dec-11 3:37am    
THANX A LOT HABIB! :D glad you help me..
Monjurul Habib 15-Dec-11 3:42am    
most welcome :)
 
Share this answer
 
Comments
musiw 12-Dec-11 20:45pm    
protected void Page_Load(object sender, EventArgs e)
{

ddl2.Visible = false;
Panel1.Visible = false;


if (!IsPostBack)
{
ddl2.Items.Clear();
}


}
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddl1.SelectedIndex == 1)
{

ListItem item;
item = new ListItem("Please Select", "Please Select");
ddl2.Items.Add(item);
item = new ListItem("KVDT & RIDT", "KVDT & RIDT");
ddl2.Items.Add(item);
item = new ListItem("Outside DT", "Outside DT");
ddl2.Items.Add(item);

ddl2.Visible = true;

}

if (ddl1.SelectedIndex == 2)
{
ListItem item;
item = new ListItem("Please Select", "Please Select");
ddl2.Items.Add(item);
item = new ListItem("ETS/EMU", "ETS/EMU");
ddl2.Items.Add(item);
item = new ListItem("Locomotive", "Locomotive");
ddl2.Items.Add(item);

ddl2.Visible = true;
}
}

protected void ddl2_SelectedIndexChanged(object sender, EventArgs e)
{
Panel1.Visible = true;
}

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