Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use page method to bind control to differnet data sources?

If I have radiobuttonlist like this:

 <asp:RadioButtonList ID="rbtn_PeriodTypeName" runat="server" DataTextField="PeriodTypeName" DataValueField="PeriodTypeId" AutoPostBack="true" RepeatDirection="Horizontal">
</asp:RadioButtonList>

And according to the user selection, I have to bind my dropdownlist from database.

<telerik:RadDropDownList ID="ddl_PeriodType" runat="server">

</telerik:RadDropDownList>

How to do something like that using Ajax page method?

EX:

My radio button list:

  • 1
  • 2
  • 3

If the user select 2 the dropdownlist should be like this:

  • W1
  • W2
  • W3
like image 596
Anyname Donotcare Avatar asked Jul 30 '16 22:07

Anyname Donotcare


1 Answers

Bind the data for all the drop downs in the initial load of the page if

  1. the number of options in each of the dropdowns is not too much
  2. the data source of the dropdowns doesn't change based on the radio button selected

And, toggle the visibility of the drop downs in the client side based on the radio button selected in the client side itself..

like image 65
Prawin Avatar answered Sep 28 '22 17:09

Prawin