Escolar Documentos
Profissional Documentos
Cultura Documentos
NET SESSION
1. keep information specific to each of your site's visitors(username, location, preferences etc.
a. session variables are stored in the web server.
CREATE SESSION variable
Session(username) = value
Session timeout default is 20 mins
Session.Timeout = value in minutes
ASP.NET APPLICATION VARIABLE
-
Appilication(UserCounter) = 0
Application.Lock()
Appilication(UserCounter) += 1
Application.UnLock()
HOW TO ADD
1. Right click the website from solution explorer
2. Select add new item
3. From the list select Global Application Class
Application_Start:
As with traditional ASP, used to set up an application environment and only called when the
application first starts.
Application_Init:
This method occurs after _start and is used for initializing code.
Application_Disposed:
This method is invoked before destroying an instance of an application.
Application_Error:
This event is used to handle all unhandled exceptions in the application.
Application_End:
Again, like classic ASP, used to clean up variables and memory when an application ends.
Application_BeginRequest:
This event is used when a client makes a request to any page in the application. It can be useful
for redirecting or validating a page request.
Application_EndRequest:
After a request for a page has been made, this is the last event that is called.
Session_Start:
As with classic ASP, this event is triggered when any new user accesses the web site.
Session_End:
As with classic ASP, this event is triggered when a user's session times out or ends. Note this can
be 20 mins (the default session timeout value) after the user actually leaves the site.
MASTER PAGE
Master Pages enables us to apply the same page layout to multiple pages in a Web
Application. A page that uses a master page is known as the content page.(draw usual page
with master page, using a banner and a menu navigation on the left pane)
HOW TO ADD
4. Right click the website from solution explorer
5. Select add new item
6. From the list select Master Page
ADD MENU CONTROL
HOW TO USE MASTER PAGE
1.
2.
3.
4.
5.
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
PUBLISH/DEPLOY WEBSITE