Your first ASP.NET Page
ASP.NET Pages are text files with a .aspx filename extension. When a browser client requests .aspx resources, the ASP.NET runtime (at the server) parses and compiles the target file into a .NET Framework class. This class can then be used to dynamically process incoming request (note that the .aspx file is only compiled the first time it is accessed -- the compiled type instance is reused across multiple requests).
An ASP.NET Page can be created simply by taking an existing HTML file and renaming its file extension .aspx (no modification or code is required).
ASP.NET provides syntax compatibility with existing ASP Pages. This includes support for <% %> code render blocks that can be intermixed with HTML content within a .aspx file. These code blocks execute in a top-down manner at page render time.
A ASP.NET page should always begin with the determination of the language.
We use the page object to this.
<% @ Page Language="VB" %>
VB is the default language for a ASP.NET page. Therefore this determination would able to
be also dropped.
| Page class: |
| Defines the properties, methods, and events common to all pages that are processed on the server by the Web Forms page framework.Page objects are compiled and cached in memory when they are requested. |
Your HTML code can follow now.
In addition to (or instead of) using <% %> code blocks to program dynamic content, ASP.NET Page developers can now leverage ASP.NET Server Controls to program web pages. Server controls are declared within a .aspx file using custom tags that contain a runat="server" attribute value.
There are two kinds of server controls:
HTML control elements
WEB control elements
HTML controls will instantiated for every HTML- TAG that contain the runat=server attribute value, i.e. <div id="test" runat=server></div>
WEB controls will instantiated if you use i.e the <asp:TextBox id="test" runat=server></asp:TextBox> Tag. It is the advantage of these controls that they have an automatic browser recognition and a data tie.
One continues.