I'm creating a user control to access information from a db. In the members type, I added a property (userid). The idea is ro read that information when the user logs in the site and use it to query the db.
My testing user control (vb.net) have a button and a label. When the button is pressed, the userid should show in the label. I have this code:
ProtectedSub Button1_Click(ByVal sender AsObject, ByVal e As EventArgs) Handles Button1.Click
Dim n As umbraco.cms.businesslogic.member.Member
Label1.Text = n.getProperty(
"UserId").Value.ToString
EndSub
The error I recive is (translated using google, because my message is in spanish):
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
retrieve member info in vb.net
Hi,
I'm stuck again :S.
I'm creating a user control to access information from a db. In the members type, I added a property (userid). The idea is ro read that information when the user logs in the site and use it to query the db.
My testing user control (vb.net) have a button and a label. When the button is pressed, the userid should show in the label. I have this code:
The error I recive is (translated using google, because my message is in spanish):
Looks like the object "n" is empy.
Any ideas?
Thanks
Javier
Hi, you declare object, but don't create it with something like this
Thanks for the answer.
That didn't work. 'getCurrent() not member of umbraco.cms.businesslogic.member.Member'
I tried with n = umbraco.cms.businesslogic.member.Member.GetCurrentMember()
but still same error.
try
umbraco.library.GetCurrentMember()
Peter
Hi Peter,
I recive this:
Value of type 'System.Xml.XPath.XPathNodeIterator' cannot be converted to 'umbraco.cms.businesslogic.member.Member'.
I asume the object declaration also need to be changed, but dont know to what.
Thanks
Javier
I remove all the lines and leave only
that gives as answer the value
MS.Internal.Xml.XPath.XPathSelectionIterator
I'm still lost :S
this is so embarrassing .... I didn't login :/
Now it works. lol
is working on a reply...