Visual InterDev

Displaying Records

See Also

You can display data on your Web page by using data-bound design-time controls, such as labels, text boxes, and list boxes, and provide navigation among the records by using a navigation control.

To add a data-bound control to an ASP or HTML page

  1. Make sure that you have set options to view controls graphically. From the View menu, choose View Controls Graphically. To set this option as default, use the HTML node of the Options dialog box.

  2. Open an ASP or HTML page that contains a Recordset control in the editor.

  3. Drag a data-bound control from the Design-Time Controls tab of the Toolbox onto the page. For example, you can drag a Textbox control onto the page to display the contents of a particular field.

  4. Right-click the control and choose Properties.

  5. Set the Recordset property of the control to the name of a Recordset control on the current page.

  6. If the control has a Field property, set it to the name of the field from the recordset you want the control to display.

  7. Set other control properties as desired.

    For more information on data-bound controls and setting their properties, see Design-Time Controls and Dialog Boxes and Windows.

  8. Close the properties window, save the .asp or .htm file, and preview the file in the browser. The text box will display the field you selected for the first record in the connected database.

    For information on previewing ASP or HTML pages in a browser, see Previewing a Page in a Browser.

You can easily provide navigation among the records you display on your Web page by using the RecordsetNavbar control.

To provide navigation among records

  1. Open the ASP or HTML page in the editor.

  2. Drag the RecordsetNavbar control from the Design-Time Controls tab of the Toolbox onto the page.

  3. Right-click the control and choose Properties.

  4. Set the Recordset property of the control to the name of a Recordset control on the ASP or HTML page.

  5. If you want, close the properties window, save the .asp or .htm file, and preview the file in the browser. You can use the RecordsetNavbar control to move among the records in the underlying recordset.

By default, the RecordsetNavbar control provides Move to First, Next, Previous, and Move to Last buttons. You can use these buttons to display the different records in the underlying recordset on the page.

You can also customize navigation behavior by writing event handlers and using the object model exposed by this control. For more information, see RecordsetNavbar control.

You can also use the Grid design-time control to display multiple records from a database on your page. For more information, see Grid Design-Time Control, the Data-bound Grid Sample and Grid Properties Dialog Box.

For more information about displaying your data on Web pages, see Viewing Data, Modifying Data, and Creating Event-Driven Forms.