Aspnet Applications And State Management

TYPE THIS:

<OBJECT RUNAT=" Server" ID="Items"

CLASS="System.Collections.ArrayList"/>

RESULT:

After this object is placed in the Global.asax file, you can then work with the Items array list on any page.

I Untitled - Notepad

DeclareSeiverSideObjectGlobalTemplate.asax - Notepad

File Edit Format Help

OBjJECT RUNAT-'Server" SCOPE-'fcession" ID="ltems"

|CLASS='jSystem.Collections. ArrayLisl|'>H/OBJECT>0

<SCRIPT LANGUAGE="C#" RUNAT="Setver":

void Application_Start() {

string stringSiteName = "My Lifetime Application["applicationSiteName"] =

void Application_End() {

Application["applicationSiteName"] =

void Session_Start() {

Response.Write("<FONT FACE='Ve called. ..<BR/></FONT>");

string stringUserGreeting = "Welcomi to My Lifetime Goals Session["sessionllserGreeting"] = sti

void Session_End() {

Between the quotation marks (""), type the kind of object you want to declare.

Goals";

stringSiteName;

dana'>Session Start e ngUserGreeting;

, Click where you want to close the <OBJECT> tag and type </OBJECT>.

DeclareSeiverSideObjectGlobalTemplate.asax - Notepad

Goals";

stringSiteName;

dana'>Session Start e ngUserGreeting;

, Click where you want to close the <OBJECT> tag and type </OBJECT>.

Click File O Save As to open the dialog box.

le Type a name for the Web page.

Click File O Save As to open the dialog box.

W Click 0 to select the folder where you want to store your file.

le Type a name for the Web page.

Note: Click the Yes button if you are prompted about replacing the file.

Note: A System.Collections.ArrayList variable with a name of Items will be available for each session created for the default Web site.

Was this article helpful?

0 0

Post a comment