ASP.NET Page Syntax
The topics in this section describe the markup syntax that you can use to declaratively create ASP.NET pages or user controls, which are text files that have .aspx or .ascx file name extensions, respectively.
An ASP.NET page is defined as a file in a Web application with an .aspx file name extension with an HTML form element that specifies
runat="server". You can optionally specify an @ Page directive or other directive (as appropriate to the type of page that you are creating), one or more Web server controls, and server code.
The mapping of file name extensions to ASP.NET is done by Internet Information Services (IIS).
You must include your HTML form element within <html> and <body> tags. Some browsers will return an error if you exclude these tags.
If you want your pages to conform to XHTML standards, you must include additional elements, such as a
DOCTYPE element. For details, see ASP.NET and XHTML.
The following example shows a basic ASP.NET page.
<%@ Page Language="VB" %> <html> <body> <form runat="server"> </form> </body> </html>
In This Section
- ASP.NET Syntax for HTML Server Controls
Defines the syntax that you can use to declaratively author and programmatically manipulate HTML elements on an ASP.NET page or user control.
- ASP.NET Syntax for Web Server Controls
Defines the syntax that you can use to declaratively author and programmatically manipulate Web server controls on an ASP.NET page.
- ASP.NET Syntax for Validation Server Controls
Defines the syntax that you can include in an ASP.NET page or user control to declaratively author server controls that validate user input.
- Individual ASP.NET Web Server Controls
Describes how you can use server controls when you build ASP.NET pages and user controls.