I am new to Umbraco datatypes and am trying to access .NET Memberships from the datatype, but it seems to not be working. I can do the same thing on the front-end in a usercontrol, but this usercontrol using the user control wrapper in the backend fails on Membership.GetUser(id). Here is my code:
protected void emailVerification_click ( object sender, EventArgs e ) { sign_up su = new sign_up (); string id = Request["id"].ToString ();
var member = Membership.GetUser ( id ); MembershipUser mu = Membership.GetUser ( member.ProviderUserKey ); su.sendVerificationEmail ( MemberProfile.GetUserProfile ( mu.UserName ) ); msgTxt.Text = "A verification email has been sent"; }
Thanks for your reply, Michael. I just realized that I am trying to pass an ID into the GetUser method, which is expecting a string username. I will try something different!
Accessing Members from datatype
Hi,
I am new to Umbraco datatypes and am trying to access .NET Memberships from the datatype, but it seems to not be working. I can do the same thing on the front-end in a usercontrol, but this usercontrol using the user control wrapper in the backend fails on Membership.GetUser(id). Here is my code:
protected void emailVerification_click ( object sender, EventArgs e )
{
sign_up su = new sign_up ();
string id = Request["id"].ToString ();
var member = Membership.GetUser ( id );
MembershipUser mu = Membership.GetUser ( member.ProviderUserKey );
su.sendVerificationEmail ( MemberProfile.GetUserProfile ( mu.UserName ) );
msgTxt.Text = "A verification email has been sent";
}
Any insight or help would be greatly appreciated!
Don
Hi Don,
Can you maybe post the error message you get? This will help searching in the correct direction :-)
Cheers,
Michael.
Thanks for your reply, Michael. I just realized that I am trying to pass an ID into the GetUser method, which is expecting a string username. I will try something different!
OK,
Good luck further !
Cheers,
Michael.
I was able to the member ID from the Request. If anyone knows a better way of doing this, I would be interested to hear!
is working on a reply...