Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to: Add HTML Server Controls to an ASP.NET Web Page Using the Designer

Adding HTML server controls is like adding any HTML element, except that you convert the element to a server control so that you can work with it in server code.


For information about controls for Web Forms pages, see ASP.NET Web Server Controls Overview.

To add an HTML server control to an ASP.NET Web page using the designer

  1. From the HTML tab of the Toolbox, drag an HTML element onto the page.

  2. Convert the element to a control by right-clicking it and choosing Run As Server Control.

    Visual Web Developer adds the attribute runat="server" to the element, which causes ASP.NET to treat the element as a control. A glyph (WebFormsServerControlGylph screenshot) appears on the control in Design view to indicate that it is a server control.

    For information about adding controls directly in the .aspx file, see How to: Add HTML Server Controls to a Web Forms Page using ASP.NET Syntax.

See Also

Community Additions

© 2015 Microsoft