This is a migrated thread and some comments may be shown as answers.

Error when slider initially hidden.

5 Answers 116 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Jon Hobbs
Top achievements
Rank 1
Jon Hobbs asked on 03 Sep 2007, 10:40 PM
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

5 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 05 Sep 2007, 11:34 AM
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
0
Jon Hobbs
Top achievements
Rank 1
answered on 05 Sep 2007, 03:51 PM
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
0
Petio Petkov
Telerik team
answered on 07 Sep 2007, 08:06 AM
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
0
SteveChadbourne
Top achievements
Rank 1
answered on 08 Oct 2007, 10:06 PM
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
0
Tsvetie
Telerik team
answered on 11 Oct 2007, 12:53 PM
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
Tags
Slider
Asked by
Jon Hobbs
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Jon Hobbs
Top achievements
Rank 1
SteveChadbourne
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or