Try our conversational search powered by Generative AI!

Changing style for EPiServer login.aspx

Vote:
 

I can't seem to figure this one out on my own, is it possible to change the design/style of the login.aspx page? I've try to add a App_Theme to my project but that only applies to the site and not the /Util/ pages!

 

Please if anyone know how to get me gooing, I apriciate all your knowledge ;)

#44078
Sep 30, 2010 10:52
Vote:
 

PageAdaptors can be used.   
 public class LoginPageAdaptor: PageAdapter
    {
        protected override void OnInit(EventArgs e)
        {
           // (this.Page as EPiServer.UI.Util.Login).
            this.Page.Header.Controls.Add(new Literal() { Text = "<link rel=\"Stylesheet\" type=\"text/css\" href=\"/custom/styles/login.css?1\"   />" });

            //System.Web.UI.Control ctr = FindControl(this.Page,"LoginControl");
            //if (ctr != null)
            //{
            //    int n = ctr.Parent.Controls.IndexOf(ctr);
            //    ctr.Parent.Controls.AddAt(n + 1, new Literal() { Text = "anders was here" });
            //}
            base.OnInit(e);
        }
        System.Web.UI.Control FindControl(System.Web.UI.Control start,string id)
        {
            if (start.ID == id)
                return start;
            foreach (System.Web.UI.Control child in start.Controls)
            {
                var tmp = FindControl(child, id);
                if (tmp != null)
                    return tmp;
            }
            return null;
        }
    }

    

 

 

#44079
Sep 30, 2010 10:58
Vote:
 

Im quite novice using EPiServer, where should I put this class?

#44086
Sep 30, 2010 12:12
Vote:
 
 Anywhere, and then you need to register it 
in App_Browsers/ folder
<browsers>
  <browser refID="Default">
    <controlAdapters>
      <adapter controlType="System.Web.UI.HtmlControls.HtmlHead" adapterType="EPiServer.UI.WebControls.ControlAdapters.HtmlHeadAdapter" />


      <adapter controlType="EPiServer.UI.Util.Login" adapterType="[FULLPATH]LoginPageAdaptor" />
    </controlAdapters>
  </browser>
</browsers>
    
This won't touch EPiServer, since it's buildt in .NET functuionality
#44087
Sep 30, 2010 12:17
Vote:
 

Or, make your own login page, the url to it is specified in web.config:

<authentication mode="Forms">
	<forms name=".EPiServerLogin"
		   loginUrl="Util/login.aspx"
		   timeout="120" />
</authentication>
    

 

#44092
Sep 30, 2010 13:32
Vote:
 

:), mine method is more fun :)

#44093
Sep 30, 2010 13:36
Vote:
 

Thanks the bouth of you for taking your time to help me :)

#44094
Sep 30, 2010 13:37
Vote:
 

Anders,  That is halarious.  But yes, works like a dream.  Page Adapters take alittle more knowledge and know how but over all, your not replicating a form that is already in place.

Gratitude for you help as always.

#44106
Sep 30, 2010 18:11
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.