c# - how to add custom parameters to membership create user wizard? -
i confused right now. ive read solutions problem, every single 1 different.... people web applications projects , web site projects need different solutions.
what have in thoughts:
i have web application project
i created table userprofile
in table store additional columns link image.
my problem right when call registeruser_createduser
on submit, can't find way guid of newly created user :
protected void registeruser_createduser(object sender, eventargs e) { formsauthentication.setauthcookie(registeruser.username, createpersistentcookie: false); textbox imageurl = registeruserwizardstep.contenttemplatecontainer.findcontrol("imageurl") textbox; userprofile.savenewprofileinformation("place new created user guid", imageurl.text); string continueurl = registeruser.continuedestinationpageurl; if (!openauth.islocalurl(continueurl)) { continueurl = "~/"; } response.redirect(continueurl); }
how guid of new created user? , on right track @ solve problem?
you need created user username
{ formsauthentication.setauthcookie(registeruser.username, createpersistentcookie: false); //if user created, username membershipuser createduser = membership.getuser(registeruser.username); guid userid = new guid(createduser.provideruserkey.tostring()); textbox imageurl = registeruserwizardstep.contenttemplatecontainer.findcontrol("imageurl") textbox; //use userid above code userprofile.savenewprofileinformation(userid, imageurl.text); }
Comments
Post a Comment