"object required" error

3 posts, 0 answers
  1. Jessie
    Jessie avatar
    26 posts
    Member since:
    Mar 2009

    Posted 10 Aug 2009 Link to this post


        I am trying the example of RadSlider for ASP.NET AJAX - First Look using VS2008 and IE7. 

        When I put the coding inside the Content, I get a javascript error "object required" as below:

        Anyone know how to solve this problem? Thanks in advance for the help.

    asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

        <asp:ScriptManager id="ScriptManager" runat="server" />
                <script type="text/javascript">
                    function ZoomImage(sender, eventArgs)
                        var sliderValue = sender.get_value();
                        var img = $get("img_preview");
                        var imageHeight = 212;

                    //Error: object required
                    img.style.height = sliderValue/150 * imageHeight + "px";

                <img src="Images/top.gif" alt="" style="display:block;"/><div style="background:white;float:left;width:412px;height:280px;overflow:auto;"><img id="img_preview" src="Images/pic.gif" alt=""/></div><div style="float:left;background-image:url(Images/SliderBckg.gif);height:280px;background-repeat:no-repeat;width:87px;padding-top:5px;padding-left:31px;">
                <telerik:RadSlider ID="zoomSlider" runat="server"                 









  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 11 Aug 2009 Link to this post

    Hi Jessie,

    I built up a test demo based on your code but unfortunately to no avail - I was not able to reproduce the error you describe. I tested the demo both with the 2009.1.402 version as you noted and also with the latest build but no error was thrown. Would you please examine the attached test demo and let me know whether I am missing something? Once I am able to observe the problem locally I will do my best to help. 

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
  4. Jessie
    Jessie avatar
    26 posts
    Member since:
    Mar 2009

    Posted 11 Aug 2009 Link to this post

    Hi Svetlina,

        Thanks for your reply. 

        I already solve the problem by myself.

        I just change var img = $get("img_preview");
        to var img = document.getElementById("<%=img_preview.ClientID%>");

        Then, the slider can be zoom in and zoom out already. Thanks.
Back to Top