472,353 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 1673

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...
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...
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>...
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...
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...
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...
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...
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();...
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...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.