473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Set a profile variable in session_start asp 2.0

How do I set a profile variable in the Session_Start section of Global.asax.

Here is a sample of my code from Global.asax:

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
Application.Lock()
Dim Id As Int32 'This Id will be used while getting device information
Id = mdot.SessionTrack.IncrementSession() 'Create new Session record
.....
Application.UnLock()
End Sub

The mdot.SessionTrack.IncrementSession() function returns a value created from a SQL database insert.
What I want to do is maintain the value of 'Id' for this session so I can use it as a key in future database functions. I tried creating a profile name "Id" but I get an error out when trying to set it in this code section. Apparently I can only set a profile value from a page object.

Thanks, Arial
Jul 20 '07 #1
0 1703

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: getdotnet | last post by:
I am trying to access the profile object in Session_start in Global.asax I get the "Object refernce not set to an instance of object." error at the foll line.... profile.Name=strUserName Can...
23
by: lwoods | last post by:
I am trying to pass some info to another page on my site. I set "session_start()" in page 1, assign a session variable to a value, then execute a "header('Location: ....')." But on the target...
5
by: Saber | last post by:
in <system.web> of web.config I've: <profile> <properties> <add name="EnterTime" type="System.DateTime" allowAnonymous="true"/> </properties> </profile> And in Session_Start of global.asax:
1
by: ryan.mclean | last post by:
Hi all, Playing with this new profile stuff and I need to load the Profile object with values when the user's session starts. The profile object does not seems to be available in the...
15
by: bb nicole | last post by:
The company profile showed blank after user login and click the company profile button. Supposed the company profile should not be blank and will show the company information which call from...
12
by: bb nicole | last post by:
I have do a update profile for company where they can update after view their profile, but it cannot function... I need to submit the whole job portal soon, but still got many problem in my coding,...
3
by: Jack | last post by:
Hi everyone, I am stuck on something really stupid and simple. Here is what I am trying to do. Login, check the username and password against db and if it checks out then check the logged variable...
12
by: Kurda Yon | last post by:
I am wandering which way to assign a value to a session variable exist. Which of the following examples will work. Example #1: session_start(); session_register("ex"); $ex = 2.0; Example...
5
by: Twayne | last post by:
Hi, If ever a newbie wants to know how much he has to learn yet, he only has to look here<g>!! ANYway: PHP 5.2.5; XP Pro SP2+, local Apache Server My actual question is: How do I get a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.