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.
Note |
|---|
| 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
-
From the HTML tab of the Toolbox, drag an HTML element onto the page.
-
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 (
) 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
Tasks
How to: Add Web Server Controls to a Web Forms Page Using the Web Forms DesignerHow to: Add Controls to an ASP.NET Web Page Programmatically
How to: Convert HTML Server Controls to HTML Elements (Visual Studio)
How to: Set HTML Server Control Properties Programmatically
Note