views:

844

answers:

1

Hi - I have a asp:dropdownlist populated by a storedproc which i want to replace with a flexbox. I see that flex box expects a json based content to it. Any pointers how to replace my code for that ?

    <asp:DropDownList ID="StepDropDown" runat="server" AutoPostBack="True" DataSourceID="SteppingDataSource" DataTextField="Name" DataValueField="S_ID" OnSelectedIndexChanged="StepDropDown_SelectedIndexChanged" />

    <asp:SqlDataSource ID="SteppingDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PerfMonConnectionString %>" SelectCommand="GetSteppings" SelectCommandType="StoredProcedure" />

Thanks in advance for the help!

A: 

The replacement won't be trivial. There are two big hurdles: (1) FlexBox uses AJAX to access the Json data rather than somewhat traditional databinding as displayed in your sample code (2) You will need to convert the data to Json format.

If you are interested in a sample, you can find one here which demonstrates the how to render the FlexBox in a div, communicate with a HTTPHandler (rather than an .ASPX file) to receive the data and there's a very basic data access layer which writes out the Json data.

The replacement is doable (I've done it) but it isn't a slamdunk.

Ben Griswold