ASP.NET

ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages. Owned by Microsoft to allow programmers to build dynamic web sites, web applications and web services. First released in January 2002 with version 1.0 of the.NET Framework, and is the successor to Microsoft’s Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.

 

History

There were releases in 2000 and 2001; ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET Framework. Even prior to the release, dozens of books had been written about ASP.NET, and Microsoft promoted it heavily as part of its platform for Web services. Scott Guthrie became the product unit manager for ASP.NET, and development continued apace, with version 1.1 being released on April 24, 2003 as a part of Windows Server 2003. This release focused on improving ASP.NET’s support for mobile devices.

ASP.NET Web pages, known officially as Web Forms, are the main building blocks for application development. Web forms are contained in files with a “.aspx” extension; these files typically contain static (X)HTML markup, as well as markup defining server-side Web Controls and User Controls where the developers place all the rc content[for the Web page. Additionally, dynamic code which runs on the server can be placed in a page within a block

<% — dynamic code — %>, which is similar to other Web development technologies such as PHPJSP, and ASP. With ASP.NET Framework 2.0, Microsoft introduced a new code-behind model which allows static text to remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs or .aspx.fs file (depending on the programming language used).

 

Directives.

directive is a special instruction on how ASP.NET should process the page.  The most common directive is <%@ Page %> which can specify many attributes used by the ASP.NET page parser and compiler.

 

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "---//W3C//DTD XHTML 1.0  //EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  protected void Page_Load(object sender, EventArgs e)  
  {
    // Assign the datetime to label control
    lbl1.Text = DateTime.Now.ToLongTimeString();
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>Sample page</title>
</head>
<body>
  <form id="form1" runat="server">
Code-behind solutions[edit]
<%@ Page Language="C#" CodeFile="SampleCodeBehind.aspx.cs" Inherits="Website.SampleCodeBehind"
AutoEventWireup="true" %>
The above tag is placed at the beginning of the ASPX file. The CodeFile property of the @ Page directive specifies the file (.cs or .vb or .fs) acting as the code-behind while the Inherits property specifies the Class from which the Page is derived. In this example, the @ Page directive is included in SampleCodeBehind.aspx, then SampleCodeBehind.aspx.cs acts as the code-behind for this page:
Source language C#:
using System;
namespace Website
{
  public partial class SampleCodeBehind : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      Response.Write("Hello, world");
    }
  }
}
Source language Visual Basic.NET:
Imports System
Namespace Website
  Public Partial Class SampleCodeBehind 
          Inherits System.Web.UI.Page
          Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
             Response.Write("Hello, world")
          End Sub
  End Class
End Namespace

 

In this case, the Page_Load() method is called every time the ASPX page is requested. The programmer can implement event handlers at several stages of the page execution process to perform processing.

The current compiler for ASP.NET Technologies is Visual Studio.

Leave a Reply

Your email address will not be published. Required fields are marked *