Subscribe

RSS Feed (xml)

Creating an ASP.NET Page

To create an ASP.NET page (a Web Form), you simply create a file with an .ASPX
extension and place it in a Web folder.The ASPX page is as follows:
<%@ Page Language=”vb” Explicit=”true” Strict=”true” %>


A simple ASP.NET Page. All @Page attributes are optional.
The ASP.NET engine will process any ASPX page, even if it doesn’t contain any code,
just as is done in ASP.There are about 20 optional parameters you can set in the Page
directive.The three listed in this example (Language, Explicit, and Strict) are optional,
but are strongly recommended. If Language is omitted, the default language specified
in the web.config file is used.Two additional items that are worth mentioning are the
Src and Codebehind attributes. Src is used to specify a file to use for the codebehind
class when the page is first requested.The class found at this location is compiled the first
time the page is requested.The Codebehind attribute is similar—it is used at compile
time by Visual Studio .NET to maintain a link between ASPX pages and their codebehind
classes. Do not use both the Src and Codebehind attributes in a Visual Studio
.NET project or you will get a duplicate class error; the same class is compiled and referenced
twice. In addition to Src or Codebehind, you must also specify the Inherits
attribute in order to use a codebehind class.

No comments:

Variety in the Web World