Try our conversational search powered by Generative AI!

Changing style for EPiServer login.aspx


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 ;)

Sep 30, 2010 10:52

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" });
        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;




Sep 30, 2010 10:58

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

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

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

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

<authentication mode="Forms">
	<forms name=".EPiServerLogin"
		   timeout="120" />


Sep 30, 2010 13:32

:), mine method is more fun :)

Sep 30, 2010 13:36

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

Sep 30, 2010 13:37

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.

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.