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 16 of 16

Thread: Remove "OK to Email" and "Over 13" Boxes during Registration

  1. #1
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default Remove "OK to Email" and "Over 13" Boxes during Registration

    I'm trying to remove the checkboxes for the "OK to Email?" and "Over 13 years old?" that a customer must check during registration. I would like them to be set for true by default if possible. I found a post from a year ago, and I followed the instructions (I've looked through createaccount.aspx and createaccount.aspx.cs) but I haven't been able to find the controls for them. I assume the post was made during v8. I currently am using v9 with SP1 installed. I have found in createaccount.aspx where it calls the string resource for them, but that is all.

    Did the method of removing these change? Or am I missing something simple? Any help is appreciated!

    (Here is the post I mentioned)
    Last edited by sha87; 01-25-2011 at 09:04 AM.

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Did you find the folder where all the controls are stored (/Controls)? In that folder is a control called Signin.ascx. That is the control where you need to make the modifications you want.

    BTW I wouldn't remove those options. I would set their defaults appropriately and then hide them. This way any scripts or code that depends on them won't break.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  3. #3
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    Thanks for the reply! I looked through the sign-in under the control folder and while I see the variables, It doesn't look like that is where they are located for registration.

    And yes, hiding them and setting them to "Yes" by default is what I would like to do. I know it SHOULD be as simple as commenting out the line where they are used in registration and then setting the variables to TRUE in the background, but I can't find where to do it. I went through the post I mentioned earlier, but couldn't find the spot in the files that it mentioned.

    Edit:

    I do see the following lines in createaccount.aspx

    Code:
    <asp:Literal ID="Literal2" runat="server" Text="<%$ Tokens:StringResource,createaccount.aspx.78 %>"></asp:Literal><asp:CheckBox
                    ID="SkipRegOver13" Visible="true" runat="server" CausesValidation="True" ValidationGroup="registration" />
    Would that be the line that I need to modify somehow for the Over 13 box? I have no variables named anything like "Over13.Checked" or "OKToEmail.Checked"
    Last edited by sha87; 01-27-2011 at 09:15 AM.

  4. #4
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    yes, the ASP:Checkbox part of that piece of code is what you want to modify. Just set the visibility of that control to hidden and set it's default to what you want it to be and you'll be fine.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  5. #5
    Cam.o is offline Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Default

    whats the proper way to enable this by default? ive tried adding Checked="true" to the code but for whatever reason it still doesnt work correctly.

    heres the exact code i have in createaccount.aspx
    Code:
    <asp:CheckBox ID="SkipRegOver13" Checked="True" Visible="true" runat="server" CausesValidation="True" ValidationGroup="registration" />

  6. #6
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    In case anyone else needs it, there is actually an appconfig named "RequireOver13Checked" that will remove the box for that. Not sure how I missed it, but it made hiding it quite easy. I still needed to modify the createaccount.aspx for the "OK to Email" though.

    Thanks CJ for the help!

  7. #7
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Quote Originally Posted by Cam.o View Post
    whats the proper way to enable this by default? ive tried adding Checked="true" to the code but for whatever reason it still doesnt work correctly.

    heres the exact code i have in createaccount.aspx
    Code:
    <asp:CheckBox ID="SkipRegOver13" Checked="True" Visible="true" runat="server" CausesValidation="True" ValidationGroup="registration" />
    Unfortunately since the the page has a control on it called ctrlAccount you'll have to modify the source of the control or the source of the page. If modifying the page have a look at the variable ctrlAccount.OKToEmailYes and ctrlAccount.OKToEmailNo and set them accordingly.

    Alternatively you could just put two lines at the beginning on the CreateAccount routine to set those values.

    Code:
    ctrlAccount.OKToEmailYes = True
    ctrlAccount.OKToEmailNo = False
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  8. #8
    nharkrader is offline Junior Member
    Join Date
    Mar 2010
    Location
    NYC
    Posts
    25

    Default RequireOver13Checked ID #519

    Check ID 519 in AppConfig Parameters.

  9. #9
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    Is it possible to hide the "OK to email" all together?
    I have managed to remove the over 13 but can not get rid of the OK to email.

  10. #10
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Have you tried changing the visibility of the check box?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  11. #11
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    I don't see a place to do that in the "createaccount.aspx" file.
    There are only 3 instances associated with the email:

    OKToEmailCaption="<%$ Tokens:StringResource, createaccount.aspx.26 %>"

    OKToEmailNoCaption="<%$ Tokens:StringResource, createaccount.aspx.28 %>"

    OKToEmailYesCaption="<%$ Tokens:StringResource, createaccount.aspx.27 %>"

    I see the checkbox for the over 13 which is set to false but not for OK to Email anywhere?

  12. #12
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Since it is a control you have to edit the control code. Look at about line 1277 of Account.vb in AspDotNetStorefrontControls. You can comment out the things you don't want to show.

    Remember to recompile and redeploy the DLL for changes to take effect.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  13. #13
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    A quick question on this.. I did not notice this when I got it working, but when a customer creates an account, the system properly assigns "OkToEmail" to true. However, if they click "Update My Account" on the account page, OkToEmail gets set back to false in the system. I assume my problem is in Account.cs since it works fine on creation.

    Anyone have any thoughts? I have this in my Account.cs:

    Code:
    public bool OKToEmailYes
            {
                get { return _rbOKToEmailYes.Checked; }
                set { _rbOKToEmailYes.Checked = true; }
            }
    Code:
            public bool OKToEmailNo
            {
                get { return _rbOKToEmailNo.Checked; }
                set { _rbOKToEmailNo.Checked = false; }
            }
    Thanks!

  14. #14
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    I would check the database first to make sure that the values are being committed correctly.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  15. #15
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    I checked my Database this morning while testing. It correctly assigns a "1" for OkToEmail when I create them. Upon opening the My Account page, it still stays "1". However, as soon as I click "Update My Account" it sets OkToEmail to "0". I'm hoping there is a simple fix / code I can insert... Thanks for the help so far though!

    I saw a post from 6-7 months ago where an Admin said that OkToEmail is related to AddressControl somehow, but I do not see anything relating to Email in that file.
    Last edited by sha87; 03-17-2011 at 09:10 AM.

  16. #16
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    I would trace the code that executes when you click the update my account button. Or have a look at the value of the check box at the time you click the button and see if it reads how you'd like it to.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM