c# - How to customize CreateUserWizard to get UserId and UserName values? -
i using membership provider
deal user registration , logging website. membership provider
part of package comes through:
install-package microsoft.aspnet.providers
i have 2 aspx
pages 1 has createuserwizard
control , other has login
control. registration , logging working correctly.
i have defined profile
properties in web.config file:
<profile defaultprovider="defaultprofileprovider"> <properties> <add name="id" type="system.guid" /> <add name="username"/> </properties>
what trying able take userid
, username
values on registration of user, , store them profile.id
, profile.username
respectively.
how customize createuserwizard
achieve this?.
my try:
when show createuserwizard
on browser. can see button named "create user", thought place extend on , add code take required values. clicked small arrow on createuserwizard
, choose customize create user setup
, editable template doesn't include corresponding button of "create user".
so possible way achieve that?
in aspx file under events of createuserwizard control, there "createduser" event can create.
in cs file of createuser function put in:
membershipuser newuser = membership.getuser(newuserwizard.username); guid newuserid = (guid)newuser.provideruserkey;
newuser.username give username, , newuserid give id. @ point should have need.
Comments
Post a Comment