Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having two radio buttons, one dropdownlist and two textbox. When first radio button is selected dropdownlist gets populated with data from table1 and if second radio button is selected than dropdownlist gets populated with data from table2. i want this to be done in javascript.

Moreover Ihave connection string specified in web.config
ASP.NET
<asp:RadioButton ID="radMail" Text="Mailwise Statistics" runat="server" GroupName="stat_select" onclick="ch(1)" ClientIDMode="Static" /><br />
<asp:RadioButton ID="radDraft" Text="Draftwise Statistics" runat="server" GroupName="stat_select" onclick="ch(2)" ClientIDMode="Static" /><br />
<asp:DropDownList ID="ddlSelectMail" runat="server" Width="51px" Height="16px"></asp:DropDownList>
<asp:TextBox ID="txtMessageId" runat="server" Width="127px"></asp:TextBox></td>
<asp:TextBox ID="txtSubject" runat="server" Width="301px" Height="16px"></asp:TextBox>


My next question is accoding to value selected from dropdownlist the data should be displayed in two textboxes.

In any of the case I dont want the page to post back.
Posted
Updated 18-Feb-14 23:00pm
v2

1 solution

Hi,

Get data from the both tables and store in a variable client side ex : arr1 and arr2 . Then based on the radio button bind the appropriate array list to the drop down.
 
Share this answer
 

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