S
Steve
Hi All
I have an asp.net 2.0 web with a standard login control
I want to pass some extra variables to the redirected page after the successful login
I just can't get it to work. help much appreciated
-------------------------------------------------------------------------------------
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Context.Items.Clear()
Context.Items.Add("UserNamevalue", Me.Login1.UserName)
Context.Items.Add("mydbkeyvalue", 2)
FormsAuthentication.RedirectFromLoginPage("steve", False)
Server.Transfer("~/memberpages/demos.aspx", True)
End If
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
----------------------------------------------------------------------------------------------------------------------------------
In a link button onclick event on the demos.aspx
Me.lblsamupdate.Text = "Context " & Context.Items("UserNamevalue").ToString
I get error 'Object reference not set to an instance of an object'
Why?????????
I have an asp.net 2.0 web with a standard login control
I want to pass some extra variables to the redirected page after the successful login
I just can't get it to work. help much appreciated
-------------------------------------------------------------------------------------
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Context.Items.Clear()
Context.Items.Add("UserNamevalue", Me.Login1.UserName)
Context.Items.Add("mydbkeyvalue", 2)
FormsAuthentication.RedirectFromLoginPage("steve", False)
Server.Transfer("~/memberpages/demos.aspx", True)
End If
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
----------------------------------------------------------------------------------------------------------------------------------
In a link button onclick event on the demos.aspx
Me.lblsamupdate.Text = "Context " & Context.Items("UserNamevalue").ToString
I get error 'Object reference not set to an instance of an object'
Why?????????