ASP.NET application and page life cycle 2
http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx?msg=3443071#xx3443071xx
ASP.NET application and page life cycle
Introduction
The Two step process
Creation of ASP.NET environment
Process request using MHPM events fired
In What event we should do what?
A sample code for demonstration
Zooming ASP.NET page events
Source code
References
Introduction
In this article we will try to understand what are the different events which takes place right from the time the user sends a request, until the time request is rendered on the browser. So we will first try to understand the two broader steps of an ASP.NET request and then we will move in to different events emitted from ‘HttpHandler’, ‘HttpModule’ and ASP.NET page object. As we move in this event journey we will try to understand what kind of logic should go in each every of these events.
This is a small Ebook for all my .NET friends which covers topics like WCF,WPF,WWF,Ajax,Core .NET,SQL etc you can download the same from Click here or else you can catch me on my daily free training @ Click here
The Two step process
from 30,000 feet level ASP.NET request processing is a 2 step process as shown below. User sends a request to the IIS:-
• ASP.NET creates an environment which can process the request. In other words it creates the application object, request, response and context objects to process the request.
• Once the environment is created the request is processed through series of events which is processed by using modules, handlers and page objects. To keep it short lets name this step as MHPM (Module, handler, page and Module event), we will come to details later.
In the coming sections we will understand both these main steps in more details.
Creation of ASP.NET environment
Step 1:- The user sends a request to IIS. IIS first checks which ISAPI extension can serve this request. De
相关文档:
1、使用Page.ClientScript.RegisterClientScriptBlock
RegisterClientScriptBlock方法可以把JavaScript函数放在页面的顶部。也就是说,该脚本用于在浏览器中启动页面。
Code
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object send ......
缓存
缓存机制
页输出缓存:保存页处理输出,下次重用所保存的输出
应用程序缓存:允许缓存所生成的数据,如DataSet
㈠页输出缓存
1、页输出缓存的几中形式
①<%@ OutputCache Duration="60" VaryByParam="None" Location="Any"%>
Location指定在哪个地方缓存,Any任何地方都缓存。
60秒以内看到的都 ......
asp.net自动生成静态页面代码
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
......
这是关于Asp.Net/XML深入编程的技术书,作者精心设计了66个实例详细介绍了.Net Framework以及XML技术在.Net Framework的编程方法和技巧。全书由12章构成,内容包括.Net平台的建立、Asp.Net的Web Forms、控件、数据访问、Web Service、Asp.Net的设置和跟踪、Asp.Net的安全 ......
一、认识Web.config文件
Web.config文件是一个XML文本文件,它用来储存 ASP.NET Web 应用程序的配置信息(如最常用的设置ASP.NET Web 应用程序的身份验证方式),它可以出现在应用程序的每一个目录中。当你通过VB.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一个默认的
Web.config文件,包括默认的配置设置 ......