More in this section

Forums / Developing with Sitefinity / Create User link on LoginForm

Create User link on LoginForm

2 posts, 1 answered
  1. Joel
    Joel avatar
    40 posts
    30 Nov 2010
    06 Dec 2012
    Link to this post
    Hey all, 

    I need to run code when a user is logged in so I've got a user control that instanciates a new LoginControl and adds a handler for when a user is logged in.

    private LoginControl CreatedOverloadedLoginControl() {
        LoginControl oscpaLoginControl;
        oscpaLoginControl = new LoginControl();
        // expose the membership provider property
        if (!string.IsNullOrEmpty(this.MembershipProvider)) {
            oscpaLoginControl.MembershipProvider = MembershipProvider;
        if (!DisableAptifyLogin) {
            oscpaLoginControl.LoggedIn += oscpaLoginControl_LoggedIn;
        oscpaLoginControl.PreRender += oscpaLoginControl_PreRender;
        return oscpaLoginControl;

    I've tried to modify the "oscpaLoginControl.CreateUserUrl" in every event in the user control's life cycle.  Each time I make a change to it, it reverts to "javascript(0);".

    void oscpaLoginControl_PreRender(object sender, EventArgs e) {
        var oscpaLoginControl = (LoginControl)sender;
        oscpaLoginControl.PasswordRecoveryText += "<br />";
        oscpaLoginControl.PasswordChangeText += "<br />";
        oscpaLoginControl.CreateUserText += "<br />";
        if (!string.IsNullOrEmpty(CreateUserUrl) && !string.IsNullOrEmpty(CreateUserText)) {
            oscpaLoginControl.CreateUserText = CreateUserText;
            oscpaLoginControl.CreateUserUrl = CreateUserUrl;
            oscpaLoginControl.ShowRegisterUserLink = true;
        // expose the css class and add the new login control to our login
        oscpaLoginControl.CssClass = TopLevelElementCSSClass;

    How should I be modifying the LoginControl's CreateUserUrl Property? Is there a system setting that I'm not aware of?

    Thank you!
  2. Joel
    Joel avatar
    40 posts
    30 Nov 2010
    06 Dec 2012
    Link to this post
    After hours of testing, I found my issue.

    I had to "Enable" SMTP messages from my website.

    From Admistration, click "Settings", and "Advanced". 
    Under System -> SMTP (Email Settings) add a mail server.
    (under the covers, it adds a row to your SystemConfig.config)
    add title="Articles" moduleId="00000000-0000-0000-0000-000000000000" type="Articles.ArticlesModule" startupType="OnApplicationStart" version="" name="Articles" />
        <smtpSettings host="" />
            <add type="Telerik.Sitefinity.Web.UI.ContentUI.Config.ContentViewDefinitionElement">
                    <add type="Telerik.Sitefinity.Forums.Web.Config.ThreadsViewMasterElement" />
                    <add type="Telerik.Sitefinity.Forums.Web.Config.ForumsViewMasterElement" />

    Then add the <>.. mail config to your web.config (if you're managing at a higher level than individual website web.configs, then you may have to go to Machine.config or whatever level you manage at).
          <issuerTokenResolver type="Telerik.Sitefinity.Security.Claims.SWT.WrapIssuerTokenResolver, Telerik.Sitefinity"/>
            <network host="" />
      <!-- Begin telerik section  -->
          <environment platform="WindowsAzure"/>
          <sitefinityConfig storageMode="Database" />
      <!-- End telerik section  -->

    Then, you will be able to modify those properties without them reverting to "javascript(0);". 
2 posts, 1 answered