Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custome registration moduleICustome registration moduleI
Previous
 
Next
New Post
1/29/2009 11:22 PM
 

I  have developed my own custome registration module. Data is going user table and other table correctly. But when user register , user not login automatically.

I ll put code to here. How can i adjust this code to login automatically

 

try
       
        {
         // Only attempt a save/update if all form fields on the page are valid
         lblError.Text = "one";
         if ( Page.IsValid == true)           
           
         {
             lblError.Text = "2";
             // update the user record in the database
             UserController objUsers = new UserController();
             UserInfo ObjUser = default(UserInfo);

             if (Id == -1)
             {
                 lblError.Text = "3";
                 ObjUser = new UserInfo();
                 if (PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId) {
                     ObjUser.PortalID = -1;
                     ObjUser.IsSuperUser = true;
                 }
                 else {
                     ObjUser.PortalID = PortalId;
                     lblError.Text = "4";
                 }
                 ObjUser.Membership.Username = txtUserName.Text ;
                 ObjUser.Username = txtUserName.Text;
                 ObjUser.Profile.FirstName = txtFname.Text ;
                 ObjUser.Profile.LastName = txtLName.Text ;
              
                 ObjUser.Membership.Email = txtUserName.Text;

                 ObjUser.AffiliateID = Null.NullInteger;

                 ObjUser.Membership.Password = txtPAssword.Text ;
                 Id = objUsers.AddUser(ObjUser, true);
                 ObjUser.UserID = Id;

                 PortalSecurity objPortalSecurity  = new PortalSecurity();

                 objPortalSecurity.UserLogin(txtUserName.Text, txtPAssword.Text, this.PortalId, this.PortalAlias,this.

               //  UserCreateStatus createStatus = UserController.CreateUser(ref ObjUser);

                 lblError.Text = ObjUser.UserID.ToString();
                 //lblError.Text = "5";
                 if (Id >= 0)
                 {
                     DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();
                     objEventLog.AddLog(ObjUser, PortalSettings, UserId, txtUserName.Text , DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.USER_CREATED);
                     Mail.SendMail(PortalSettings.Email, txtUserName.Text , "", DotNetNuke.Services.Localization.Localization.GetSystemMessage(ObjUser.Profile.PreferredLocale, PortalSettings, "EMAIL_USER_REGISTRATION_PUBLIC_SUBJECT", ObjUser), DotNetNuke.Services.Localization.Localization.GetSystemMessage(ObjUser.Profile.PreferredLocale, PortalSettings, "EMAIL_USER_REGISTRATION_PUBLIC_BODY", ObjUser), "", "", "", "", "",
                     "");
                     Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "filter=" + txtFname.Text.Substring(0,1)), true);
                 }
                 // registration error
                 else {
                     //AspNetSecurity.MembershipCreateStatus UserRegistrationStatus = default(AspNetSecurity.MembershipCreateStatus);
                     //UserRegistrationStatus = (AspNetSecurity.MembershipCreateStatus)UserId * -1;
                     //UserController objUserController = new UserController();
                     //lblMessage.Text = objUserController.GetRegistrationStatus(UserRegistrationStatus);
                 }
             }
             else {
                 // if activating an account, send notification
                 ObjUser = objUsers.GetUser(PortalId, Id);
               
                 if ((ObjUser != null))
                 {
                     //if (chkAuthorized.Checked) {
                     //    //if (ObjUser.Membership.Approved != chkAuthorized.Checked) {
                     //    //    Mail.SendMail(PortalSettings.Email, userControl.Email, "", Services.Localization.Localization.GetSystemMessage(ObjUser.Profile.PreferredLocale, PortalSettings, "EMAIL_USER_REGISTRATION_PUBLIC_SUBJECT", ObjUser), Services.Localization.Localization.GetSystemMessage(ObjUser.Profile.PreferredLocale, PortalSettings, "EMAIL_USER_REGISTRATION_PUBLIC_BODY", ObjUser), "", "", "", "", "",
                     //    //    "");
                     //    //}
                     //}
                   
                     //update the user
                     ObjUser.Profile.FirstName = txtFname.Text ;
                     ObjUser.Profile.LastName = txtLName.Text ;
                  
                     objUsers.UpdateUser(ObjUser);
                 }
              
               //  Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", (!string.IsNullOrEmpty(Request.QueryString["filter"]) ? "filter=" + Request.QueryString["filter"] : "").ToString), true);
             }
         }
     }
     //Module failed to load
     catch (Exception exc) {
         lblError.Text = exc.ToString();
     }

 

 

 
New Post
2/4/2009 8:22 AM
 

Plz send me both design and coding page on my email address.

manjur.momin@gmail.com

hussain_momin1492@yahoo.co.in

manjurhusen@sharmainfoway.com

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custome registration moduleICustome registration moduleI


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out