I have a radiobuttonlist that have 3 options,and a dropdownlist in which the values come according to the option selected in radiobuttonlist.now i want it to be done without creating postback to the server.how to do it?
Printable View
I have a radiobuttonlist that have 3 options,and a dropdownlist in which the values come according to the option selected in radiobuttonlist.now i want it to be done without creating postback to the server.how to do it?
check the postback properties for the control
[QUOTE=chowsys;5005]I have a radiobuttonlist that have 3 options,and a dropdownlist in which the values come according to the option selected in radiobuttonlist.now i want it to be done without creating postback to the server.how to do it?[/QUOTE]
If the items to be loaded in the dropdown list is static(like sex difference, Age, % Marks scored etc) , then we could use javascript to load the dropdownlist onclick/onchange/onchecked of radio button.
If the items to be loaded in the dropdownlist is dynamic, (say the data comes from DB), we could use AJAX call backs to load the dropdown list on click of radio button.
Hope this helps....
Use AJAX for the same
Fetch all the results together in xml and parse itusing javascript.Your xml will contain all the possible combinations for radiobutton selections and corrosponding ddl.
OR
May be Ajax.
u can use AJAX then the page wont get refresh.
you can download the AJAX ToolKit from the "asp.net" website.then add the toolkit in your visual Studio.then drag the script manager,Updatepanel controls from the ajax Toolbar.the coding is shiwn below:
<asp:ScriptManager ID="ScriptManger1" runat="server">
</asp:Scriptmanager>
<asp:UpdataPanel ID="upnl" runat="server">
<Content Template>
<aspropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
</aspropDownList>
</Contenttemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" >
</Triggers>
</asp:Updatepanel>
Regards,
Nithya.R