Saturday 16 April 2016

DNN switch style when language switched

If you want to change the layout or the skin of your pages when the language changed;

update the Default.aspx.cs page, by the follwoing code

Search about
ClientResourceManager.RegisterStyleSheet(this, string.Concat(ctlSkin.SkinPath, "skin.css"), FileOrder.Css.SkinCss);

commit it and add the following code bellow it,

if (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "en-US")
            {
                ClientResourceManager.RegisterStyleSheet(this, ctlSkin.SkinPath + "skin.css", FileOrder.Css.SkinCss);
            }
            else
            {
                ClientResourceManager.RegisterStyleSheet(this, ctlSkin.SkinPath + "rtl.skin.css", FileOrder.Css.SkinCss);
            }

No comments:

Post a Comment