Error when trying to register a new user

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 13 ans
I am getting an internal error when trying to register a new user.  It dies when I click register.  The user is setup and can login if we find our way back to the login page but none of the user information is recorded in customer info.

Here is the error I receive in the log:
********************************************************

Log type:  Unknown  
Severity:  11  
Message:  Exception of type 'System.Web.HttpUnhandledException' was thrown.  
Exception:  System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at NopSolutions.NopCommerce.Web.Modules.CustomerRegisterControl.CreatedUser(Object sender, EventArgs e) in F:\Own\NopCommerce\Solution\Solution\NopCommerceStore\Modules\CustomerRegister.ascx.cs:line 154 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.register_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\registration\1b770717\4117e2c6\App_Web_ehem6o9f.48.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  

********************************************************
Thanks for your help
Il y a 13 ans
Did you try to make changes in the registration form , by adding or deleting something ?
Il y a 13 ans
Yes I did.  I got it working finally.  I changed how I was commenting out the gender question.  i still cannot get it to work right when I comment out date of birth on the info screen, however I was able to hide it on the registration form.  I am trying to avoid having to recompile so I am not touching the .cs files.
Il y a 13 ans
If you want to remove date of birth from the registration form:

1. Edit the Customer Register control (File: Modules\CustomerRegister.ascx) and comment out the table row for date of birth (lines 62-73):
Original code block (comment out the following code: surround the following code in the control file with <%--   --%>)


<tr class="Row">
    <td class="ItemName">
        <%=GetLocaleResourceString("Account.DateOfBirth")%>:
    </td>
    <td class="ItemValue">
        <asp:TextBox runat="server" ID="txtDateOfBirth" />
        <asp:ImageButton runat="Server" ID="iDateOfBirth" ImageUrl="~/images/Calendar_scheduleHS.png"
            AlternateText="Click to show calendar" /><br />
        <ajaxToolkit:CalendarExtender ID="cDateOfBirthButtonExtender" runat="server" TargetControlID="txtDateOfBirth"
            PopupButtonID="iDateOfBirth" />
    </td>
</tr>



-------

2. Edit the Customer Info control (to remove empty date of birth field from "My Account") (File: Modules\CustomerInfo.ascx) and comment out & hide the row for date of birth (lines: 50-61).  ASP controls are hidden (by setting their visibility to false) instead of commented out so you don't have to recompile (if you recompile, you can remove the entire block and remove the references to the controls in the codebehind).

The following is the commented and hidden code block:


<%--<tr class="Row">
    <td class="ItemName">
        <%=GetLocaleResourceString("Account.DateOfBirth")%>:
    </td>
    <td class="ItemValue">--%>
        <asp:TextBox runat="server" ID="txtDateOfBirth" visible="false"/>
        <asp:ImageButton runat="Server" ID="iDateOfBirth" ImageUrl="~/images/Calendar_scheduleHS.png"
            AlternateText="Click to show calendar" visible="false"/><%--<br />
        <ajaxToolkit:CalendarExtender ID="cDateOfBirthButtonExtender" runat="server" TargetControlID="txtDateOfBirth"
            PopupButtonID="iDateOfBirth" />
    </td>
</tr>--%>



-------

If you want to fully remove all references to the the date of birth field, you will have to edit about ten files and recompile the solution, but the changes here remove it from the customer's view.
Il y a 13 ans
Thanks Mike but when I do that it still throws an error.  The only thing that works is when I use an HTML comment ( <!-- --> )... It only works for the CustomerRegister.ascx page.  Neither comment will work on the CustomerInfo.ascx page.  

Why do you think that is happening?
Il y a 13 ans
You can use <!-- --> too, this will work

are you in the developing phase ? by developing phase i mean you're website is online or still working on it ?

If you're in developing phase, you can refresh your page/solution

for that :

Download a fresh copy of nopCommerce, all the ascx page in which you made changes, copy those fresh pages from fresh copy of nopCommerce and paste it and re-place in your project so that you're making fresh changes

make changes that i mentioned above for taking out date of birth from registration form (Comment those things by <!-- -->)

then save changes and close the project

now open the solution (NopCommerce.sln) in visual studio one more time and when it is opened, IN THE SOLUTION EXPLORER > right click on nopCommerceStore folder and select "Set as start up project" (refer to this image : click here )

now press F5

if it asks you to select Yes/No, Select yes and try to register, it should work
Il y a 13 ans
let me know if it's working or not
Il y a 13 ans
I got it Mike.  Thanks for the help.  I got it to work on both pages.  I just needed to look closer at what you sent the first time.  I assumed you were commenting out the entire <tr> but then noticed you had it broken up a bit.  I commented out each part of the each <td> seperately and it worked.  Thanks.
Il y a 13 ans
good to know everything's working fine at your side
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.