Dreamweaver

Add ASP.NET form controls to a page

You can use the visual design environment in Dreamweaver to add ASP.NET form controls to your page.

  1. Open an ASP.NET page in Design view (View > Design).
  2. Position the insertion point where you want the form control to appear on the page.

    Form controls must be inserted inside a form that has an runat='server' attribute in its tag. If your page does not have a form, Dreamweaver automatically creates one with a runat='server' attribute when you insert the first ASP.NET form control. If your page contains an HTML form, Dreamweaver automatically adds the runat='server' attribute to the existing form tag when you insert the first form control.

  3. Do one of the following:
    • Select Insert > ASP.NET Objects; then select the form control from the submenu.

    • In the ASP.NET category of the Insert bar, select the form control’s icon.

  4. Set the form control’s options in the dialog box that appears, and click OK.

    For more information on the properties of each control, see the documentation on the Microsoft website at http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconaspsyntaxforwebcontrols.asp.

    For each control, make sure you specify an ID attribute, such as txtCity for a TextBox control or lbxCountry for a ListBox control.