Register Page and Register Link

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/16/2013 8:32:55 AM
Gravatar
Total Posts 1

Register Page and Register Link

OS: Windows 7 Pro 32 bit
DB: MSSQL Express 2008
mojoPortal Version: 2.3.9.7 
.Net version: 4.0

Hello to All, 

I'm new user of this forum.

I need some information about the difference of the code showed below.

In order to change the registration page, I've modified the keys in web.config of mojoPortal.Web 

    <add key="CustomRegistrationPage" value="/mycontrol/register.aspx" />
        <add key="RedirectRegistrationPageToCustomPage" value="true" />


This change, work perfectly, but if I change the single value of RedirectRegistrationPageToCustomPage to false
the link in the menu bar remain my custom Registration page.

I think that is a bug.

In the RegisterLink.cs the code 

"if (WebConfigSettings.CustomRegistrationPage.Length > 0)" 

should be changed in 

"if ((WebConfigSettings.CustomRegistrationPage.Length > 0) && (WebConfigSettings.RedirectRegistrationPageToCustomPage))"

otherwise the param "RedirectRegistrationPageToCustomPage" will not have any effect if not inside the "Register.aspx"


mojoPortal.Web.UI.RegisterLink
    RegisterLink.cs
        private string GetUrlToUse()
               {
                   string result = "/Secure/Register.aspx";
->                    if (WebConfigSettings.CustomRegistrationPage.Length > 0)
                    {
                        result = WebConfigSettings.CustomRegistrationPage;
                    }
            .
            .
            .
        }

mojoPortal.Web.UI.Pages.Register
    Register.aspx.cs
        private void Page_Load(object sender, EventArgs e)
        {
->            if ((WebConfigSettings.CustomRegistrationPage.Length > 0) && (WebConfigSettings.RedirectRegistrationPageToCustomPage))
                   {    
                WebUtils.SetupRedirect(this, SiteRoot   WebConfigSettings.CustomRegistrationPage);
                        return;
?            }
            .
            .
            .
        }
        
Is correct? or I'm don't understand the function?

Marco

5/16/2013 12:27:33 PM
Gravatar
Total Posts 18439

Re: Register Page and Register Link

Hi,

They are separate but related things.

CustomRegistrationPage configures the link so it points to your custom register page, if you don't want it to do that then don't configure it.

RedirectRegistrationPageToCustomPage forces the built in /Secure/Register.aspx page to redirect to your custom registration page. That way if a user gets to the built in registration page by url instead of by the register link, it will redirect them to your custom page.

So if you are using a custom registration page you should use both settings, if you are not then you should not use either one.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.