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.
Note
The mapping of file name extensions to ASP.NET is done by Internet Information Services (IIS).
Note
You must include your HTML form element within <html> and <body> tags. Some browsers will return an error if you exclude these tags.
Note
If you want your pages to conform to XHTML standards, you must include additional elements, such as a DOCTYPE element. For details, see XHTML Standards in Visual Studio and ASP.NET.
The following example shows a basic ASP.NET page.
<%@ Page Language="VB" %>
<html>
<body>
<form runat="server">
</form>
</body>
</html>
In This Section
Related Sections
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.ASP.NET Web Server Controls
Describes how you can use server controls when you build ASP.NET pages and user controls.