Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello sir,
I have the following code.
I have two dropdownlists, ddlNoOfQuestions and ddlCorrectOption and a button.

In my (.aspx) page I have the following code for ddlNoOfQuestion.
<asp:DropDownList ID="ddlNoOfQuestions" runat="server" Width="70px"
AutoPostBack="true">
<asp:ListItem>Select
<asp:ListItem>1
<asp:ListItem>2
<asp:ListItem>3
<asp:ListItem>4
<asp:ListItem>5
<asp:ListItem>6


and for ddlCorrectOption its is like
<asp:DropDownList ID="ddlCorrectOption" runat="server" Width="50px" Height="16px">

now what i wanted to do is when click on ddlNoOfQuestion it should add the number of textboxes dynamically which I select from the ddlNoOfQuestion. e.g. when i select 4 from the ddlNoOfQuestion it should add 4 textboxes and also it should add values from 1 to 4 into the another dropdownlist (ddlCorrectOption ) please help me in this.
thanks in advance. Confused | :confused:
Posted
Comments
creepz03 19-Dec-13 3:13am    
You can do this at the drodownlist event OnSelectedIndexChanged. When this event is raise then add the item on your second dropdown. If you knew the basic, I don think theres going to be a problem implementing this.
What have you tried and where is the problem?

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