Membership.GetUser() Does not return same value

Membership.GetUser() Does not return same value

Postby dknapp » Thu 08 Feb 2007 21:33

I am trying to see if a person has logged in, but the examples that i find to do that do not work with the MySQLDirect .NET 2 provider. I am using version

The example I am tring to use is this:

Code: Select all
If Membership.GetUser() IsNot Nothing Then
  lblDisplayName.Visible = True
  lblDisplayName.Text = "Something"
End If

When I try to use this code I get an error:
System.ArgumentNullException was unhandled by user code
Message="Value cannot be null.
Parameter name: username"
at CoreLab.Common.Web.Providers.DbMembershipProvider.GetUser(String username, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser()
at ASP.masterpage_master.Page_Load(Object sender, EventArgs e) in D:\WebSites2\\MasterPage.master:line 22
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

How would I use the MySQLDirect .NET 2 provider to check if a user has logged in?

Posts: 10
Joined: Wed 20 Sep 2006 18:26

Postby Alexey » Fri 09 Feb 2007 07:43

I can't reproduce this error. Please send me your test project.
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Return to dotConnect for MySQL