+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Custom LoginForm Template

Custom LoginForm Template

3 posts, 1 answered
  1. Daniel
    Daniel avatar
    35 posts
    Registered:
    15 Jun 2010
    18 Oct 2010
    Link to this post
    Greetings,

    Currently I have a Telerik.Sitefinity.Security.Web.UI.LoginForm control inside a Custom Control to provide a custom authentication mechanism that I need for my website. Is there a way to template this control inside the same .ascx where this control is contained? Or do I need to create the template on another .ascx file and reference it on the LayoutTemplatePath property?

    I've already tried using this method although I would prefer to keep everything in the same file. While using this method, though, I receive the following error:

    LoginForm: LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username.



    I do, however, have added a <asp:TextBox ID="UserName" runat="server" /> into the .ascx, but the error still prevails.

    Also, I can't use a global Template for all the LoginForm's. I need Sitefinity's loginform to stay with the current template and have my own loginform only with my custom template.

    What's the best way of achieve this? An example would be much appreciated. 

    Thanks in advance,
    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Oct 2010
    Link to this post
    Hello Daniel,

    You have to use LayoutTemplatePath and create a new  customized template, but the behavior you see is a bug in the control. The problem is that when you use an external template the container does not look for the controls inside the template and as a result the control thinks that there is not control of type IEditableTextControl in your template.I logged this issue for fixing. Your Telerik points have been updated.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Charles
    Charles avatar
    61 posts
    Registered:
    18 Jul 2012
    27 Aug 2012
    Link to this post
    Has this been fixed? Because Sitefinity gave me a custom login template as a work around for the image url not working (the fields there to use but is not implimented). I've put the template in the layout path and now I'm getting this error...

    C001: LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username.
     Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

     Exception Details: System.Web.HttpException: C001: LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username.

    Source Error:
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): C001: LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username.]
       System.Web.UI.WebControls.GenericContainer`1.FindControl(String id, Boolean required, String errorResourceKey) +1814387
       System.Web.UI.WebControls.LoginContainer.get_UserNameTextBox() +9444423
       System.Web.UI.WebControls.Login.get_UserNameInternal() +60
       System.Web.UI.WebControls.Login.SetEditableChildProperties() +28
       System.Web.UI.WebControls.Login.CreateChildControls() +194
       Telerik.Sitefinity.Security.Web.UI.LoginForm.CreateChildControls() +89
       System.Web.UI.Control.EnsureChildControls() +83
       System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +27
       System.Web.UI.Control.FindControl(String id) +12
       Telerik.Sitefinity.Security.Web.UI.LoginForm.get_LogoutButton() +65
       Telerik.Sitefinity.Security.Web.UI.LoginForm.OnInit(EventArgs e) +291
       System.Web.UI.Control.InitRecursive(Control namingContainer) +134
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489

3 posts, 1 answered