ASP Tutorial: A brief introduction to ASP Session Object

Source: Internet
Author: User
Tags change settings

ASP Tutorial: A brief introduction to ASP Session Object

The session object is used to store information, or to change settings for a user meeting. Variables stored in the Session object hold information to a single user and are provided to all Web pages in an application.

Let's look at a simple example.

<body>

<%
Response.Write ("<p>")
Response.Write ("The default LCID for this page:" & session.lcid & "<br/>")
Response.Write ("The date format for the above LCID is:" & Date () & "<br/>")
Response.Write ("The Currency format for the above LCID is:" & FormatCurrency (350))
Response.Write ("</p>")

session.lcid=1036

Response.Write ("<p>")
Response.Write ("The LCID is now changed to:" & Session.LCID & "<br/>")
Response.Write ("The date format for the above LCID is:" & Date () & "<br/>")
Response.Write ("The Currency format for the above LCID is:" & FormatCurrency (350))
Response.Write ("</p>")

Session.LCID = 3079

Response.Write ("<p>")
Response.Write ("The LCID is now changed to:" & Session.LCID & "<br/>")
Response.Write ("The date format for the above LCID is:" & Date () & "<br/>")
Response.Write ("The Currency format for the above LCID is:" & FormatCurrency (350))
Response.Write ("</p>")

Session.LCID = 2057

Response.Write ("<p>")
Response.Write ("The LCID is now changed to:" & Session.LCID & "<br/>")
Response.Write ("The date format for the above LCID is:" & Date () & "<br/>")
Response.Write ("The Currency format for the above LCID is:" & FormatCurrency (350))
Response.Write ("</p>")
%>

</body>

The result of the output is.

The default LCID for this page is:1033
The Date format for the above LCID is:10/31/2008
The Currency format for the above LCID is: $350.00

The LCID is now changed to:1036
The Date format for the above LCID is:31/10/2008
The Currency format for the above LCID is:350,00€

The LCID is now changed to:3079
The Date format for the above LCID is:31.10.2008
The Currency format for the above LCID is:€350,00

The LCID is now changed to:2057
The Date format for the above LCID is:31/10/2008
The Currency format for the above LCID is:? 50.00
Reprint please indicate from http://www.111cn.net/asp/asp.html

Related Article

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.