B
Beren
Hello
With trial and error I'm attempting to create an extended identity to store
some more data than just the Name, for example a Subscription and a
LastSearchPerformed property...
Is this a good idea ? I'm coming from ASP and Session variables, but I
explicitly wanted to avoid that for .NET.
The problem I'm facing is that I don't find a good way to bring my source
data from the login routine to the AuthenticateRequest event, as followed in
a little pseudocode which hopefully shows my thoughts and my errors...
[login.aspx]
Button_Click_Event
< GetUserDataFromDatabase >
....
FormsAuthentication.Redirect(sUserName, False)
End
[global.asax]
Application_AuthenticateRequest( s , e ){
If Request.IsAuthenticated Then
Dim objIdentity As
myCustomIdentityClass(Context.User.Identity.Name)
'/// This is where I need to get the data from <
GetUserDataFromDatabase >
'/// which is called in the button click event from the
unrelated page.
'/// How do I get that data here without having to call the
database for every Request ?
....
<assign roles & custom identity to Context.User>
End If
End
The main question is commented in that event,
I hope someone can help me to find the best way to do it, or just tell me
I'm completely on the wrong way to do this.
Thanks,
Beren
With trial and error I'm attempting to create an extended identity to store
some more data than just the Name, for example a Subscription and a
LastSearchPerformed property...
Is this a good idea ? I'm coming from ASP and Session variables, but I
explicitly wanted to avoid that for .NET.
The problem I'm facing is that I don't find a good way to bring my source
data from the login routine to the AuthenticateRequest event, as followed in
a little pseudocode which hopefully shows my thoughts and my errors...
[login.aspx]
Button_Click_Event
< GetUserDataFromDatabase >
....
FormsAuthentication.Redirect(sUserName, False)
End
[global.asax]
Application_AuthenticateRequest( s , e ){
If Request.IsAuthenticated Then
Dim objIdentity As
myCustomIdentityClass(Context.User.Identity.Name)
'/// This is where I need to get the data from <
GetUserDataFromDatabase >
'/// which is called in the button click event from the
unrelated page.
'/// How do I get that data here without having to call the
database for every Request ?
....
<assign roles & custom identity to Context.User>
End If
End
The main question is commented in that event,
I hope someone can help me to find the best way to do it, or just tell me
I'm completely on the wrong way to do this.
Thanks,
Beren