Re: GetUser.ProviderUserKey gives me System.NullReferenceException

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Membership.GetUser() is definitely null in your case. Meaning that the user has not actually been logged in. Can't say much since unsure about your particular scenario.

Tanzim Saqib
W: http://www.TanzimSaqib.com


"Cirene" <cirene@xxxxxxxxxxx> wrote in message news:#kiVgEk3IHA.4800@xxxxxxxxxxxxxxxxxxxxxxx
Using asp.net membership. My login.aspx page goes to the loginredirect.aspx page after the user logs in.

For some reason "Membership.GetUser.ProviderUserKey.ToString" gives me this error:
System.NullReferenceException: Object reference not set to an instance of an object. at loginredirect.Page_Load(Object sender, EventArgs e)

Any reason why? I should be logged in fine.

Is there another way in which I should get the current users UserId?

.



Relevant Pages

  • Re: The Vinland Maps Ink
    ... >>> The reason why you and I seem to be slowly becoming at loggerheads is ... > But I'm not arguing the VM on a professional level with Ken Towe. ... > Ken Towe wants those who argue for authenticity to set out a scenario ...
    (sci.archaeology)
  • Re: Nuclear Plot of "Jericho"
    ... at the world today, the biggest danger right now is from international terrorist gangs and/or their state sponsors, rather than from a superpower attack like in ... Russia has no reason to nuke us at this moment. ... politics in any way they want to create the scenario they gave us. ...
    (rec.arts.tv)
  • Re: Born To Run: What Humans Really Evolved To Do
    ... keep chimps in trees. ... It would be apparent in your scenario. ... Nope -- it's the same reason as peasants in Afghanistan ... apparent reason. ...
    (sci.anthropology.paleo)
  • Re: FolderBrowserDialog and Application Hang
    ... Object reference not set to an instance of an ... IntPtr wparam, IntPtr lparam) ... Start the application with debug - In this scenario, ... I experience once it gave me "An unhandled exception ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Unhandled Exception
    ... Object reference not set to an instance of an object. ... at StandardInclude.StoredProcedure.TemplateMain_Load(Object eventSender, EventArgs eventArgs) ... at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) ...
    (microsoft.public.dotnet.languages.vb)