473,396 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,396 software developers and data experts.

question about profil and global.asax

Hi,

i'm trying to transform an anonymous user profile to an authenticated user
profile.

I found this global.asax here below and there are some things i don't
understand.
1) where does the last function come from ( Public Sub
Profile_OnMigrateAnonymous) because in VWDeveloper, that event doesn't
appear in the available list of events?
2) when is it executed because it's not in the "Application_Start" (or _end)
neither in "session_start"? On request?
3) in that function, there is a class defined 'ProfileCommon'. I discovered
that that class was generated by a 'tool' and is not located in the
application directory but in c:\windows\microsoft.net\v2..\Temporary Asp.net
files\...\...\profile.cdcab7d2.vb .
What tool is that and when was it generated? Why is not located in the
application directory?

Thanks
Benny

<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Profile" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application shutdown
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a session ends.
End Sub

Public Sub Profile_OnMigrateAnonymous(ByVal Sender As Object, ByVal e As
ProfileMigrateEventArgs)
' get the profile for the anonymous user
Dim anonProfile As ProfileCommon = Profile.GetProfile(e.AnonymousID)

' if they have a shopping cart, then migrate that to the
authenticated user
If anonProfile.Cart IsNot Nothing Then

If Profile.Cart Is Nothing Then
profile.Cart = New Test.Commerce.ShoppingCart()
profile.Cart.Items.AddRange(anonProfile.Cart.Items )
end if

anonProfile.Cart = Nothing
End If

ProfileManager.DeleteProfile(e.AnonymousID)
AnonymousIdentificationModule.ClearAnonymousIdenti fier()

End Sub

</script>

'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.42
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.Web
Imports System.Web.Profile
Public Class ProfileCommon
Inherits System.Web.Profile.ProfileBase

Public Overridable Property Country() As String
Get
Return CType(Me.GetPropertyValue("Country"),String)
End Get
Set
Me.SetPropertyValue("Country", value)
End Set
End Property

Public Overridable Property City() As String
Get
Return CType(Me.GetPropertyValue("City"),String)
End Get
Set
Me.SetPropertyValue("City", value)
End Set
End Property
Public Overridable Property Cart() As mai.eCommerce.ShoppingCart
Get
Return
CType(Me.GetPropertyValue("Cart"),mai.eCommerce.Sh oppingCart)
End Get
Set
Me.SetPropertyValue("Cart", value)
End Set
End Property

Public Overridable Function GetProfile(ByVal username As String) As
ProfileCommon
Return CType(ProfileBase.Create(username),ProfileCommon)
End Function
End Class


Jan 24 '07 #1
0 2216

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
4
by: Al Santino | last post by:
Hello, I've created a simple C# web services project using Visual Studio 2005. My service compiles and runs correctly when called by remote clients. I'm able to step through the service in the...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.