Error when slider initially hidden.

6 posts, 0 answers
  1. Jon Hobbs
    Jon Hobbs avatar
    48 posts
    Member since:
    May 2007

    Posted 03 Sep 2007 Link to this post

    Hi Guys,

    I have a problem because my app initially hides all the controls on the page with Visible="False" and only makes them visible on a partial postback. This is fine for normal controls but Prometheus controls don't seem to load properly when visible is set to "True" on the containing panel.

    I have made this demo as simple as possible.....

    <%@ Page Language="VB" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <script runat="server"
        Sub ButtonClick() 
            PlaceHolder1.Visible = True 
        End Sub 
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Slider Test</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <div> 
            <asp:UpdatePanel ID="UpdatePanel1" runat="server"
                <ContentTemplate> 
                    <asp:Button ID="Button1" runat="server" OnClick="ButtonClick" Text="Make Slider Visible" /> 
                    <asp:PlaceHolder ID="PlaceHolder1" Visible="False" runat="server"
                        <telerik:RadSlider 
                            ID="RadSlider1" 
                            runat="server" 
                            Skin="Web20" 
                        />   
                        Testing to see if slider shows up. 
                    </asp:PlaceHolder> 
                </ContentTemplate> 
            </asp:UpdatePanel> 
             
        </div> 
        </form> 
    </body> 
    </html> 

    The slider doesn't show up properly when you hit the button. However, if you change the placeholder tag as follows....

    <asp:PlaceHolder ID="PlaceHolder1" Visible="True" runat="server">

    ..so that it shows when the page loads then it works fine.

    I hope there is a way round this as the same problem happens with tooltips, if the tooltipmanager isn't visible when the page first loads then it doesn't load properly on a callback.

    Jon
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 05 Sep 2007 Link to this post

    Hi Jon Hobbs,

    You must add reference to your skin files in the head tag and everything should be ok. For example:
    <head id="Head1" runat="server">    
        <title>Slider Test</title>   
         <link rel="stylesheet" href="../Skins/Slider.css" type="text/css"/>     
         <link rel="stylesheet" href="../Skins/Web20/Slider.Web20.css" type="text/css"/>  
          
    </head>   

    I hope that this will help you.

    Sincerely yours,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon Hobbs
    Jon Hobbs avatar
    48 posts
    Member since:
    May 2007

    Posted 05 Sep 2007 Link to this post

    Hi,

    That seems to have solved the problem in IE and firefox but not in Safari. Is there anything else that could be causing it not to work in Safari ?

    Jon
  5. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 07 Sep 2007 Link to this post

    Hello Jon Hobbs,

    There are several issues with RadSlider under Safari which are not resolved yet. However, we will fix them for the official release of the Prometheus suite.

    Greetings,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. SteveChadbourne
    SteveChadbourne avatar
    4 posts
    Member since:
    Aug 2007

    Posted 08 Oct 2007 Link to this post

    I have the same problem. My slider is initially hidden and when shown does not display.

    I have managed to get this to work in a small test project but it involved copying all the style sheets and images from the telerik Skins folder  and including them in my project using the same folder hierarchy then linking to the style sheets in the header like the example.

    Is it possible to use GetWebResourceUrl to load them directly from the dll rather than having to add extra files to my project?

    Cheers

    Steve
  7. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 11 Oct 2007 Link to this post

    Hello SteveChadbourne,
    Yes, it is possible. The names of the resource files you need for the RadSlider are:
    1. Telerik.Web.UI.Skins.Slider.css
    2. Telerik.Web.UI.Skins.Default.Slider.[Your_Skin_Name].css

    Have a look at the sample code bellow:

    protected void Page_Load(object sender, EventArgs e)  
    {  
        // Define the resource name and type.  
        String rsname1 = "Telerik.Web.UI.Skins.Slider.css";  
        String rsname2 = "Telerik.Web.UI.Skins.Default.Slider.Default.css";  
         
        Type rstype = RadSlider1.GetType();  
          
        // Get a ClientScriptManager reference from the Page class.  
        ClientScriptManager cs = Page.ClientScript;  
     
        // Write out the web resource url.          
        HtmlLink link = new HtmlLink();  
        link.Href = cs.GetWebResourceUrl(rstype, rsname1);  
        link.Attributes["rel"] = "stylesheet";  
        link.Attributes["type"] = "text/css";  
        this.Header.Controls.Add(link);  
     
        link = new HtmlLink();  
        link.Href = cs.GetWebResourceUrl(rstype, rsname2);  
        link.Attributes["rel"] = "stylesheet";  
        link.Attributes["type"] = "text/css";  
        this.Header.Controls.Add(link);  
    Sincerely yours,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017