RadSkinManager for whole Masterpage

4 posts, 0 answers
  1. le N
    le N avatar
    6 posts
    Member since:
    Feb 2010

    Posted 10 Feb 2010 Link to this post

    Hi Telerik team!

    I dropped some telerik controls on my Masterpage like:

    <telerik:RadComboBox ID="ddlLanguage" runat="server" AutoPostBack="True" >

    next i added a radSkinManager like this:

    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Telerik">
        </telerik:RadSkinManager>

    This works well, and my combobox is well skinned, but i tried to add a simple asp:button in my masterpage (In order to change theming on the fly) like this:

      RadSkinManager1.Skin = "Forest"

    But nothing happens . Any one got any idea's? thanks a lot
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 10 Feb 2010 Link to this post

    Hi Nicolas,

    How do you reproduce the described problem? I can't seem to observe it. Here is my test page:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     
    <script runat="server">
     
        protected void Button1_Click(object sender, EventArgs e)
        {
            RadSkinManager1.Skin = "Forest";
        }
         
    </script>
     
    <head runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Telerik" ShowChooser="true" />
     
    <telerik:RadCalendar ID="RadCalendar1" runat="server" />
     
    <asp:Button ID="Button1" runat="server" Text="Set Forest Skin" OnClick="Button1_Click" />
     
    </form>
    </body>
    </html>


    Kind regards,
    Dimo
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. le N
    le N avatar
    6 posts
    Member since:
    Feb 2010

    Posted 10 Feb 2010 Link to this post

    Thank you Dino,

    Indeed your sample works well. But i didn't tell you all the stuff, i explain better:

    I've got a telerik "telerik:RadComboBox" with 2 items (Corresponding to my Asp Themes):
    <telerik:RadComboBox  ID="ddlTheme" runat="server" AutoPostBack="True"  > 
                                 <Items> 
                                    <telerik:RadComboBoxItem Value="Theme1" Text="Theme 1" /> 
                                     
                                    <telerik:RadComboBoxItem Value="Theme2" Text="Theme 2" /> 
                                   </Items> 
                                </telerik:RadComboBox > 

    and here is my code behind where i tried to change the telerik skin:

    Protected Sub ddlTheme_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlTheme.SelectedIndexChanged 
            If Not Session("MonTheme") = ddlTheme.SelectedValue Then 
                Session("MonTheme") = ddlTheme.SelectedValue 
                Dim aCookie As New HttpCookie("yourCookie") 
                aCookie.Values("ThemePref") = Session("MonTheme") 
                aCookie.Expires = System.DateTime.Now.AddDays(21) 
                Response.Cookies.Add(aCookie) 
            End If 
     
             
     
            RadSkinManager1.Skin = "Black" 
            Response.Redirect(Request.Url.ToString) 
     
        End Sub 

    I tried to set the ShowChooser property of the radskinmanager to true, and it works well when i change the theme using the radskinmanager.

    Which is your advice? Thank you
  5. le N
    le N avatar
    6 posts
    Member since:
    Feb 2010

    Posted 10 Feb 2010 Link to this post

    allright i've got it. I made a mix, and i put the code:

    "radskinmanager.skin=" in my page preRender, it works!
Back to Top