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: All customers default to 'yes' to 'Ok To Email'

  1. #1
    tom is offline Junior Member
    Join Date
    Nov 2009
    Location
    Calgary, Alberta, Canada
    Posts
    11

    Default All customers default to 'yes' to 'Ok To Email'

    When new customers are creating an account, there is an option asking if it is 'OK to Email?'. Is it possible to default that to 'yes' and make it so the customer cannot change this?
    -- Tom

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Sure...but you'll need to modify the createaccount.aspx/createaccount.aspx.cs(.vb) and account.aspx/account.aspx.cs(.vb) files to remove the option that the customer selects and pass the correct value to the methods updating or creating the customer account.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    tom is offline Junior Member
    Join Date
    Nov 2009
    Location
    Calgary, Alberta, Canada
    Posts
    11

    Default

    Thanks for the reply!

    Currently, this option defaults to 'no'. Can you point me in the direction of what controls that default selection so that I can change it to 'Yes'?

    I had a look through createaccount.aspx and createaccount.aspx.cs (I cannot locate createaccount.aspx.vb) and cannot figure this out myself. I have a feeling I am going to have to learn a lot more about visual basic to be able to make this customization.

    If anyone could point me at a particular sting(s) that I should look for, what would be helpful.

    Thanks in advance!
    -- Tom

  4. #4
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Open the createaccount.aspx.cs file.

    from InitializePageContent() method, find these lines below and comment it out.

    Code:
    OKToEMailYes.Checked = (ThisCustomer.EMail.Length != 0);
    OKToEMailNo.Checked = !OKToEMailYes.Checked;
    and add this below that line:
    Code:
    OKToEMailYes.Checked = true;

  5. #5
    tom is offline Junior Member
    Join Date
    Nov 2009
    Location
    Calgary, Alberta, Canada
    Posts
    11

    Default

    Somehow, my commenting is incorrect. Did I misunderstand your directions? I recieve this message when a user attempts to register as a new customer:

    Server Error in '/wrcnet_store2' Application.
    Compilation Error
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS1525: Invalid expression term '<'

    Source Error:

    Line 426:
    Line 427: createaccountaspx23.Text = "*" + AppLogic.GetString("createaccount.aspx.23", SkinID, ThisCustomer.LocaleSetting);
    Line 428: <%--
    Line 429: OKToEMailYes.Checked = (ThisCustomer.EMail.Length != 0);
    Line 430: --%>


    Source File: e:\WWW\wrc.net\wwwroot\wrcnet_store2\createaccount .aspx.cs Line: 428
    -- Tom

  6. #6
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    That's incorrect, yes. Do it like this.
    Code:
    //OKToEMailYes.Checked = (ThisCustomer.EMail.Length != 0);
    //OKToEMailNo.Checked = !OKToEMailYes.Checked;

  7. #7
    tom is offline Junior Member
    Join Date
    Nov 2009
    Location
    Calgary, Alberta, Canada
    Posts
    11

    Default

    That takes care of that!

    Thanks for the help.
    -- Tom