Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 7 of 7

Thread: Adding new fields to 'createaccount.aspx'

  1. #1
    GoodFella is offline Member
    Join Date
    Mar 2009
    Posts
    99

    Default Adding new fields to 'createaccount.aspx'

    When a new customer is creating an account, I would like to know things like what his favorite sports team is. This field is not manditory.

    How would I go about doing this?

    So far, my plan is to simply add the HTML in the 'createaccount.aspx' file right below where it asks for the email address. I will include a '(!createaccount.aspx.*!)' and add that to the string manager.

    Now, what work needs to be done to the 'createaccount.aspx.cs' file? Does the following function have anything to do with it?

    "ThisCustomer.UpdateCustomer ( "

    Where / how can I look at this function?

    Thank you,
    Marc

  2. #2
    MarkC is offline Developer
    Join Date
    Aug 2006
    Posts
    166

    Default

    You will need source code for this as the source code for the customer is located in the AspDotNetStorefrontCore dll, for the additional field that you have, you'll need to add another parameter for that in the UpdateCustomer function and also a corresponding parameter on the aspdnsf_updCustomer stored procedure.

  3. #3
    GoodFella is offline Member
    Join Date
    Mar 2009
    Posts
    99

    Default

    Thank you for the reply.

    I see the code:

    ThisCustomer.UpdateCustomer (
    /*DateOfBirth*/ null,
    /*Gender*/ null,
    /*FirstName*/ FirstName.Text.Trim()
    )


    There are many fields that simply contain NULL. Can I simply make use of some of those fields? IE: DateOfBirth. I should be able to just add a new text box and tie it together, right?

    Thanks,
    Marc

  4. #4
    MarkC is offline Developer
    Join Date
    Aug 2006
    Posts
    166

    Default

    It's better to leave those fields as is, since they are mapped to another sproc parameter and table column.

    Another quick way of doing it is to directly update the field after the call to UpdateCustomer. Since at that point you already have a registered customer object.

    C#/VB.NET Code:
    DB.ExecuteSQL(string.Format("UPDATE Customer SET TestField = {0} WHERE CustomerID = {1}"DB.SQuote("test value"), ThisCustomer.CustomerID)); 
    This mod you'll only have to do on createaccount.aspx.cs, assuming you'll only be displaying the input for that field on that page.

    If that value is something you're gonna be using regularly, it's better to add it as another property on the customer object so you can access it more conveniently on other pages.
    You will need to modify a couple of stored procedures for that as well (aspdnsf_GetCustomer*) and add that field on the result set and extract the value on the Init method of the customer.

  5. #5
    Upscale_Automotive is offline Senior Member
    Join Date
    Apr 2008
    Posts
    201

    Default

    I would like to have functionality like this as well. Form fields during registration for the customers Vehicle(s) (Year Make Model) that can later be edited in their account management. Is there any way to integrate this without source code? Even a way to integrate it post-registration? or during checkout somewhere?

  6. #6
    Dusty is offline Member
    Join Date
    Jun 2009
    Posts
    176

    Default

    The changes you're looking to do would be very difficult to do without source code. It is possible to add pages to your site that get the information for which you're looking and trying to tie it to the customer's record, but to have it directly integrated with existing pages and the customer's information you'll definitely need source code.

    Dusty
    ASPDotNetStorefront Staff

  7. #7
    Upscale_Automotive is offline Senior Member
    Join Date
    Apr 2008
    Posts
    201

    Default

    Thanks for the insight Dusty, I will keep this in mind. This is not a super urgent matter, but would be a nice integration no doubt.