Use Php to simulate the asp.net Page Model

Source: Internet
Author: User

Simulating asp.net with php (as the mainstream development language) is unlikely, especially for php (as the mainstream development language) this is even more difficult for Object-Oriented dynamic languages. in these cases, simulation means that we can use this example to understand the operating mechanism of asp.net (the most powerful development language of Microsoft ). the code is very simple. You do not need to elaborate on it. This test is run on win2000, iis (Microsoft's WEB server platform) 5, and php (as the mainstream development language) 4.4.0.

Page. php (as the mainstream development language)

<? Php (as the mainstream development language)
/*************************************** ****************************************
* Sinoprise Function Classes
* CopyRight (c): 2006 Sinoprise Technology Lab
*
* Unit Name: page. php (as the mainstream development language)
* Func:
* Crate: Shuguang Yin 2006-07-15
**************************************** ***************************************/
Class SFC_Page
{

// Environment variable
/* Var $ Server;
Var $ Session;
Var $ QueryString;
Var $ Post;
Var $ Cookie;
Var $ Files;
Var $ Env ;*/

// Page control attributes
Var $ EnableViewState;

// Page properties
Var $ CharSet; // page Character Set
Var $ PageTitle; // The page title
Var $ PageStyle; // Page Style





Function SFC_Page ()
{

/* If (strcmp (substr (php (as the mainstream development language) _ VERSION,), 4)> = 0 ){


$ Server =$ _ SERVER;
$ Session =$ _ SESSION;
$ QueryString = $ _ GET;
$ Post =$ _ POST;
$ Cookie =$ _ COOKIE;
$ Files = $ _ FILES;
$ Env = $ _ ENV;


} Else {


Global $ HTTP_SERVER_VARS, $ HTTP_GET_VARS, $ HTTP_POST_VARS, $ HTTP_COOKIE_VARS, $ HTTP_POST_FILES;
Global $ HTTP_ENV_VARS, $ HTTP_SESSION_VARS;
$ Server = $ HTTP_SERVER_VARS;
$ Session = $ HTTP_SESSION_VARS;
$ QueryString = $ HTTP_GET_VARS;
$ Post = $ HTTP_POST_VARS;
$ Cookie = $ HTTP_COOKIE_VARS;
$ Files = $ HTTP_POST_FILES;
$ Env = $ HTTP_ENV_VARS;


}*/


$ This-> EnableViewState = false;


}
// Occurs before the server status is restored
Function PageInit ()
{
}


// Occurs after the server state is restored, but before the server event
Function PageLoad ()
{
}


// Occurs after a server event is triggered, but before anything is generated
Function PagePreRender ()
{
}


// When the page is generated
Function PageRender ()
{
}


// After the webpage is generated
Function PageUnLoad ()
{
}


// Display the output
Function Display ()
{


$ This-> PageInit ();
If ($ this-> EnableViewState ){
$ This-> DeCodeViewState ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.