This explanation assumes knowledge of ASP and provides a basic RedBack example. This examples uses a Stateless RBO to get details of Department codes and their descriptions from the RBO Server. These details are then stored within the page, so we only make a call to the RBO Server for these details when first entering the page. We create RedFields to store the codes and descriptions as these are used to parse the multi-values data ' Create two objects to hold multivalue Dept codes and descriptions Dim oCodes As New REDPAGESLib.RedField() Dim oDescs As New REDPAGESLib.RedField() We then check to see if we already have the data within the page or whether we need to make a call to the RBO Server to get the required data. ' do we need to get department details? if Request.Form("Codes") = "" then ' use stateless RBO Utils to get department codes and text for dropdown obj = New REDPAGESLib.RedObject obj.Open2("rbexamples", "EXMOD:Utils") obj.callMethod("GetDepts") 'now populate the redfields prop = obj.Property("DeptCodes") oCodes.StringValue = prop.Value prop = obj.Property("DeptDescs") oDescs.StringValue = prop.Value obj.Close() else oCodes.StringValue = Request.Form("Codes") oDescs.StringValue = Request.Form("Descs") End If We loop through the RedFields here, building a standard html dropdown with the correct item selected. <SELECT name="Dept"> <% ' Set dept codes and descriptions Dim sel As String For i = 1 to oCodes.Count If Dept = oCodes.Value(i).StringValue Then sel = "SELECTED " Else sel = "" %> <OPTION <%= sel %> VALUE=<%= oCodes.Value(i).StringValue %> > <%= oDescs.Value(i).StringValue %> <% Next %> </SELECT> See the rbexamplesnetvb directory to review the page's entire source code. |