.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Use Global.asax

Posted By:papsantony       Posted Date: August 13, 2010    Points: 10    Category: Visual Studio    URL: http://www.dotnetspark.com  

Use Global.asax
 

<%@ Page Language=VB Debug=true %>

Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    lblTitle.Text = Application("ApplicationName")
    lblTaxRate.Text = "Tax Rate: " & Application("TaxRate")
    lblSessionStarts.Text = "Session Starts: " _
        & Application("SessionStarts")
    lblSessionStops.Text = "Session Stops: " _
        & Application("SessionStops")
End Sub
SCRIPT>
<HTML>

<% Response.Write</font><font color="#000000">(</font><font color="#000000">Application</font><font color="#000000">(</font><font color="#2a00ff">"ApplicationName"</font><font color="#000000">)) </font><font color="#000000">%>

<BODY TEXT="black" LINK="darkred" VLINK="darkred" ALINK="red" LEFTMARGIN="40" TOPMARGIN="60">
<form runat="server">
"Tahoma" Size="+1">

    id="lblTitle" 
    BorderWidth="7px"
    BorderStyle=9
    Width="90%"
    Font-Size="25pt"
    Font-Name="Arial"
    runat="server"
/>




    id="lblTaxRate"
    runat="Server"
/>




    id="lblSessionStarts"
    runat="Server"
/>




    id="lblSessionStops"
    runat="Server"
/>




BODY>
HTML>


<%-- Global.asax
<SCRIPT LANGUAGE="VB" RUNAT="Server">
Sub Application_OnStart
    Application("TaxRate"0.5125
    Application("ApplicationName""Sample Global.asax"
End Sub
Sub Application_OnEnd
    'code that runs when application ends
End Sub
Sub Session_OnStart
    Application("SessionStarts"= _
        Application("SessionStarts"1
    Session.TimeOut = 1
End Sub
Sub Session_OnEnd
    Application("SessionStops"= _
        Application("SessionStops"1
End Sub
SCRIPT>



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend