how to change email defined when creating account?

Discussion in 'ASP .Net Web Controls' started by Dan, Feb 13, 2007.

  1. Dan

    Dan Guest

    Hi,

    I use the <asp:CreateUserWizard> control for creating memberusers. In that
    windows, one must provide an emailaddress.
    My question is: how can an user later change his emailaddress?

    Thanks
    Dan
    Dan, Feb 13, 2007
    #1
    1. Advertising

  2. Dan,

    My guess is you are using the SqlRoleProvider for storing your user
    information? One thing you could do is have a page that directly edits this
    database.

    Also, you could inherit your code from MembershipProvider and use the
    ChangeEmailAddress method to perform your task.

    Shaun McDonnell


    "Dan" <> wrote in message news:...
    > Hi,
    >
    > I use the <asp:CreateUserWizard> control for creating memberusers. In
    > that windows, one must provide an emailaddress.
    > My question is: how can an user later change his emailaddress?
    >
    > Thanks
    > Dan
    >
    Shaun C McDonnell, Feb 13, 2007
    #2
    1. Advertising

  3. Dan

    Dan Guest

    Thanks for replying.
    Yes i use the sqlserver express as database for users and memberships. It's
    the easiest way i suppose. The mdf file is created automatically.
    To be honest, i don't understand very good what you mean with:
    "you could inherit your code from MembershipProvider and use the
    ChangeEmailAddress method to perform your task".
    Could you give some hints how to perform that?
    Thanks again.


    "Shaun C McDonnell" <> schreef in bericht
    news:...
    > Dan,
    >
    > My guess is you are using the SqlRoleProvider for storing your user
    > information? One thing you could do is have a page that directly edits
    > this
    > database.
    >
    > Also, you could inherit your code from MembershipProvider and use the
    > ChangeEmailAddress method to perform your task.
    >
    > Shaun McDonnell
    >
    >
    > "Dan" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I use the <asp:CreateUserWizard> control for creating memberusers. In
    >> that windows, one must provide an emailaddress.
    >> My question is: how can an user later change his emailaddress?
    >>
    >> Thanks
    >> Dan
    >>
    Dan, Feb 13, 2007
    #3
  4. Dan,

    Here is an example of what I am talking about. Check out the methods you
    can call within the Membership object. There is a method called
    'ChangePassword'

    By creating your own MembershipProvider you could override this method and
    have a custom task performed when a user attempts to change its password.
    Here is an example:

    public class DansMembershipProvider : System.Web.Security.MembershipProvider
    {
    public ovverride bool ChangePassword(string username, string
    oldPassword, string newPassword)
    {
    // perform your password change task here.
    }
    }

    You will have to override all of the methods within the MembershipProvider
    class in order for it to be operable. On some, you can just call the base
    method (the original method) by doing the following:

    base.DeleteUser(string username, bool deleteAllRelatedData);

    When you are done, make the following change to your web.config file:


    <membership defaultProvider="DansMembershipProvider">
    <providers>
    <add name="DansMembershipProvider" type="DansMembershipProvider,
    DansMembershipProviderAssembly"/>
    </providers>
    </membership>

    Then, whenever you make calls to the methods within the Membership object,
    it will call your custom methods.

    Good luck.

    Shaun McDonnell

    "Dan" <> wrote in message news:OAC#...
    > Thanks for replying.
    > Yes i use the sqlserver express as database for users and memberships.
    > It's the easiest way i suppose. The mdf file is created automatically.
    > To be honest, i don't understand very good what you mean with:
    > "you could inherit your code from MembershipProvider and use the
    > ChangeEmailAddress method to perform your task".
    > Could you give some hints how to perform that?
    > Thanks again.
    >
    >
    > "Shaun C McDonnell" <> schreef in bericht
    > news:...
    >> Dan,
    >>
    >> My guess is you are using the SqlRoleProvider for storing your user
    >> information? One thing you could do is have a page that directly edits
    >> this
    >> database.
    >>
    >> Also, you could inherit your code from MembershipProvider and use the
    >> ChangeEmailAddress method to perform your task.
    >>
    >> Shaun McDonnell
    >>
    >>
    >> "Dan" <> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> I use the <asp:CreateUserWizard> control for creating memberusers. In
    >>> that windows, one must provide an emailaddress.
    >>> My question is: how can an user later change his emailaddress?
    >>>
    >>> Thanks
    >>> Dan
    >>>

    >
    >
    Shaun C McDonnell, Feb 13, 2007
    #4
  5. Dan

    Dan Guest

    Thanks
    Strange that the possibility for changing the email is not foreseen, just
    like changing the password ...No?



    "Shaun C McDonnell" <> schreef in bericht
    news:...
    > Dan,
    >
    > Here is an example of what I am talking about. Check out the methods you
    > can call within the Membership object. There is a method called
    > 'ChangePassword'
    >
    > By creating your own MembershipProvider you could override this method and
    > have a custom task performed when a user attempts to change its password.
    > Here is an example:
    >
    > public class DansMembershipProvider :
    > System.Web.Security.MembershipProvider
    > {
    > public ovverride bool ChangePassword(string username, string
    > oldPassword, string newPassword)
    > {
    > // perform your password change task here.
    > }
    > }
    >
    > You will have to override all of the methods within the MembershipProvider
    > class in order for it to be operable. On some, you can just call the base
    > method (the original method) by doing the following:
    >
    > base.DeleteUser(string username, bool deleteAllRelatedData);
    >
    > When you are done, make the following change to your web.config file:
    >
    >
    > <membership defaultProvider="DansMembershipProvider">
    > <providers>
    > <add name="DansMembershipProvider" type="DansMembershipProvider,
    > DansMembershipProviderAssembly"/>
    > </providers>
    > </membership>
    >
    > Then, whenever you make calls to the methods within the Membership object,
    > it will call your custom methods.
    >
    > Good luck.
    >
    > Shaun McDonnell
    >
    > "Dan" <> wrote in message
    > news:OAC#...
    >> Thanks for replying.
    >> Yes i use the sqlserver express as database for users and memberships.
    >> It's the easiest way i suppose. The mdf file is created automatically.
    >> To be honest, i don't understand very good what you mean with:
    >> "you could inherit your code from MembershipProvider and use the
    >> ChangeEmailAddress method to perform your task".
    >> Could you give some hints how to perform that?
    >> Thanks again.
    >>
    >>
    >> "Shaun C McDonnell" <> schreef in bericht
    >> news:...
    >>> Dan,
    >>>
    >>> My guess is you are using the SqlRoleProvider for storing your user
    >>> information? One thing you could do is have a page that directly edits
    >>> this
    >>> database.
    >>>
    >>> Also, you could inherit your code from MembershipProvider and use the
    >>> ChangeEmailAddress method to perform your task.
    >>>
    >>> Shaun McDonnell
    >>>
    >>>
    >>> "Dan" <> wrote in message
    >>> news:...
    >>>> Hi,
    >>>>
    >>>> I use the <asp:CreateUserWizard> control for creating memberusers. In
    >>>> that windows, one must provide an emailaddress.
    >>>> My question is: how can an user later change his emailaddress?
    >>>>
    >>>> Thanks
    >>>> Dan
    >>>>

    >>
    >>
    Dan, Feb 13, 2007
    #5
  6. Yes, but there is an UpdateUser method which will perform that task.

    Shaun McDonnell

    "Dan" <> wrote in message news:...
    > Thanks
    > Strange that the possibility for changing the email is not foreseen, just
    > like changing the password ...No?
    >
    >
    >
    > "Shaun C McDonnell" <> schreef in bericht
    > news:...
    >> Dan,
    >>
    >> Here is an example of what I am talking about. Check out the methods you
    >> can call within the Membership object. There is a method called
    >> 'ChangePassword'
    >>
    >> By creating your own MembershipProvider you could override this method
    >> and have a custom task performed when a user attempts to change its
    >> password. Here is an example:
    >>
    >> public class DansMembershipProvider :
    >> System.Web.Security.MembershipProvider
    >> {
    >> public ovverride bool ChangePassword(string username, string
    >> oldPassword, string newPassword)
    >> {
    >> // perform your password change task here.
    >> }
    >> }
    >>
    >> You will have to override all of the methods within the
    >> MembershipProvider class in order for it to be operable. On some, you
    >> can just call the base method (the original method) by doing the
    >> following:
    >>
    >> base.DeleteUser(string username, bool deleteAllRelatedData);
    >>
    >> When you are done, make the following change to your web.config file:
    >>
    >>
    >> <membership defaultProvider="DansMembershipProvider">
    >> <providers>
    >> <add name="DansMembershipProvider" type="DansMembershipProvider,
    >> DansMembershipProviderAssembly"/>
    >> </providers>
    >> </membership>
    >>
    >> Then, whenever you make calls to the methods within the Membership
    >> object, it will call your custom methods.
    >>
    >> Good luck.
    >>
    >> Shaun McDonnell
    >>
    >> "Dan" <> wrote in message
    >> news:OAC#...
    >>> Thanks for replying.
    >>> Yes i use the sqlserver express as database for users and memberships.
    >>> It's the easiest way i suppose. The mdf file is created automatically.
    >>> To be honest, i don't understand very good what you mean with:
    >>> "you could inherit your code from MembershipProvider and use the
    >>> ChangeEmailAddress method to perform your task".
    >>> Could you give some hints how to perform that?
    >>> Thanks again.
    >>>
    >>>
    >>> "Shaun C McDonnell" <> schreef in bericht
    >>> news:...
    >>>> Dan,
    >>>>
    >>>> My guess is you are using the SqlRoleProvider for storing your user
    >>>> information? One thing you could do is have a page that directly edits
    >>>> this
    >>>> database.
    >>>>
    >>>> Also, you could inherit your code from MembershipProvider and use the
    >>>> ChangeEmailAddress method to perform your task.
    >>>>
    >>>> Shaun McDonnell
    >>>>
    >>>>
    >>>> "Dan" <> wrote in message
    >>>> news:...
    >>>>> Hi,
    >>>>>
    >>>>> I use the <asp:CreateUserWizard> control for creating memberusers. In
    >>>>> that windows, one must provide an emailaddress.
    >>>>> My question is: how can an user later change his emailaddress?
    >>>>>
    >>>>> Thanks
    >>>>> Dan
    >>>>>
    >>>
    >>>

    >
    >
    Shaun C McDonnell, Feb 14, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    5
    Views:
    407
    Shaun C McDonnell
    Feb 14, 2007
  2. Oodini
    Replies:
    1
    Views:
    1,746
    Keith Thompson
    Sep 27, 2005
  3. nilapenn
    Replies:
    3
    Views:
    603
    Joe Kaplan \(MVP - ADSI\)
    Feb 14, 2005
  4. Replies:
    4
    Views:
    621
    Paul Clement
    Sep 15, 2005
  5. heycooldude
    Replies:
    0
    Views:
    147
    heycooldude
    Mar 26, 2014
Loading...

Share This Page