Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Calling Events from web page
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Duckkiller  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 14:17
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: "Duckkiller" <duckkille...@gmail.com>
Date: Sun, 8 Nov 2009 08:17:29 -0600
Local: Sun 8 Nov 2009 14:17
Subject: Calling Events from web page
Could someone please help:  I'm trying to understand how you would call
these two events from a web page.  AnonymousIdentification_Creating and
Profile_MigrateAnonymous.  The Author of the book I'm reading states that
they can be called from the web page's source.

I have included  what the author of the book I'm reading states about
working with Anonymous Identification.  I was able to get the
AnonymousIdentification_Creating to fire by simply placing it in the
Global.asax file. It worked and the AnonymousID changed.  Is that because
the sub in Listing 15-15 is actually a delegate to an event?  Also, the next
section talks about the Profile_MigrateAnonymous() event and that it can be
placed in the page that deals with the migration.  How do you do get it to
fire.  Everything that I have read on events states that you delcare and
event, you raise the event, and then you set a sub to be called when the
event fires using the 'Handles' clause.  Or you can create a Delegate and
point that delegate to a method with a similar signature.  But the below
explanation does not follow any of those rules.   Any help would be greatly
appreaciated.

Any help would be greatly appreaciated

Thanks

Dave

******************************  From the book ******************************

In working with the creation of anonymous users, be aware of an important
event which you can use from your Global.asax file that can be used for
managing the process:  AnonymousIdentification_Creating

By using the AnonymousIdentification_Creating event, you can work with the
identification of the end
user as it occurs. For instance, if you do not want to use GUIDs for
uniquely identifying the end user, you can change the identifying value from
this event instead.
To do so, create the event using the event delegate of type
AnonymousIdentificationEventArgs, as illustrated in Listing 15-15.

Listing 15-15:

Public Sub AnonymousIdentification_Creating(ByVal sender As Object, ByVal e
As AnonymousIDentificationEventArgs)
        e.AnonymousID = "Anonymous test " & DateTime.Now()
End Sub

The Author Also states this about migrating Anonymous users using
Profile_MigrateAnonymous event handler.

When working with anonymous users, you must be able to migrate anonymous
users to registered users. for example, after an end user fills a shopping
cart, he can register on the site to purchase the items.  At that moment,
the end users switches from being an anonymous user to a registered user.
For this reason, ASP.NET provides a Profile_MigrateAnonymoous event handler
enabling you to migrate anonymous users to registered users.  The
profile_MigrateAnonymouseevent requires a data class of type
ProfileMigrateEventArgs.  It is placed either in the page that deals with
the migration or within the Global.asax file (if it can be used from
anywhere within the application).  The use of this event is illustrated in
Listing 15-17

Listing 15-17

Public Sub Profile_MigrateAnonymous(ByVal sender As Object, ByVal e As
ProfileMigrateEventArgs)

     Dim anonymousProfile As ProfileCommon =
Profile.GetProfile(e.AnonymousID)
     Profile.LastVisited = anonymousProfile.LastVisited

End Sub


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory A. Beamer  
View profile   Translate to Translated (View Original)
 More options 11 Nov, 15:35
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: "Gregory A. Beamer" <NoSpamMgbwo...@comcast.netNoSpamM>
Date: Wed, 11 Nov 2009 07:35:19 -0800
Local: Wed 11 Nov 2009 15:35
Subject: Re: Calling Events from web page
"Duckkiller" <duckkille...@gmail.com> wrote in
news:F79B3CDB-44D7-4D57-A120-E1DB567084DF@microsoft.com:

> Could someone please help:  I'm trying to understand how you would
> call these two events from a web page.
> AnonymousIdentification_Creating and Profile_MigrateAnonymous.  The
> Author of the book I'm reading states that they can be called from the
> web page's source.

he actually states, although not emphatically, that you can code them in
the global.asax file. It is the global handler for the application and
session.

These are events fired, and they need to be handled by a file that is
called as part of the normal ASP.NET process. The page is at a higher
level in the "stack", so to speak, so it cannot directly handle the
event, at leats not without a lot of kludging.

If you want to handle the event, you can do it in the global.asax file.
If you need to do something with it from the page, you will have to
store it where it can be pulled. Session might be an option, as you need
some separation of different anonymous calls. You can also create a
custom property bag, but it would have to be cleaned out over time, so
session is probably easiest. ;-)

Peace and Grace,
Greg

--
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google