Paging and javascript problem

7 posts, 1 answers
  1. Vasja Petkovska
    Vasja Petkovska avatar
    10 posts
    Member since:
    Dec 2009

    Posted 15 May 2010 Link to this post

    I am using ListView with paging to display photos, and jquery lightbox js to display the photos when clicked.
    On the first page the photos display using the lightbox, but when i click next the photos wont display right, like the js is not loaded.
    The ListView is inside asp:Panel control, and the panel is handled by AjaxManager.
    Any ideas?
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 17 May 2010 Link to this post

    Hello Vasja,

    For your convenience I am attaching sample application demonstrating usage of Lightbox plugin with RadListView.

    Greetings,
    Nikolay
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vasja Petkovska
    Vasja Petkovska avatar
    10 posts
    Member since:
    Dec 2009

    Posted 17 May 2010 Link to this post

    Hello, i reviewed the code but i dont see what am i missing? This is part of my code

    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
    <link href="css/slimbox2.css" rel="stylesheet" type="text/css" /> 
    <script type="text/javascript" src="js/slimbox2.js"></script> 
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="ListViewPanel1"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="ListViewPanel1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
    </telerik:RadAjaxManager> 
     
    <asp:Panel ID="ListViewPanel1" runat="server"
                                <telerik:RadListView ID="listImages" runat="server" ItemPlaceholderID="ImagesContainer" 
                                    OnItemCommand="listImages_ItemCommand" AllowPaging="true" PageSize="16" DataKeyNames="ImageID" 
                                    OnPageIndexChanged="listImages_PageIndexChanged"
                                    <ItemTemplate>...</ItemTemplate> 
                                    <LayoutTemplate> 
                                        <fieldset id="FieldSet1"
                                            <asp:PlaceHolder ID="ImagesContainer" runat="server" /> 
                                            <center> 
                                                <table cellpadding="5" cellspacing="5" width="600px"
                                                    <tr> 
                                                        <td> 
                                                            <asp:Button runat="server" ID="btnFirst" CommandName="Page" CommandArgument="First" 
                                                                Text="Прва" Enabled="<%#Container.CurrentPageIndex > 0 %>" /> 
                                                        </td> 
                                                        <td> 
                                                            <asp:Button runat="server" ID="btnPrev" CommandName="Page" CommandArgument="Prev" 
                                                                Text="Претходна" Enabled="<%#Container.CurrentPageIndex > 0 %>" /> 
                                                        </td> 
                                                        <td> 
                                                            <span style="vertical-align: top; position: relative; top: 4px">Страна 
                                                                <%#Container.CurrentPageIndex + 1 %> 
                                                                од 
                                                                <%#Container.PageCount %></span
                                                        </td> 
                                                        <td> 
                                                            <asp:Button runat="server" ID="btnNext" CommandName="Page" CommandArgument="Next" 
                                                                Text="Следна" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" /> 
                                                        </td> 
                                                        <td> 
                                                            <asp:Button runat="server" ID="btnLast" CommandName="Page" CommandArgument="Last" 
                                                                Text="Последна" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" /> 
                                                        </td> 
                                                    </tr> 
                                                </table> 
                                            </center> 
                                        </fieldset> 
                                    </LayoutTemplate> 
     </telerik:RadListView> 
    </asp:Panel> 

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 18 May 2010 Link to this post

    Hello Vasja,

    Please notice how the plugin is initialized in my code:
    1.<script type="text/javascript">         
    2. function pageLoad()
    3. {
    4.   $('#ourManualGallery a').lightbox();
    5. }          
    6.</script>

    Greetings,
    Nikolay
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Vasja Petkovska
    Vasja Petkovska avatar
    10 posts
    Member since:
    Dec 2009

    Posted 06 Jun 2010 Link to this post

    I am working on this problem for two weeks and i cant solve it!
    I have even consulted with the people who developed the lightbox i am using.
    I have tried your solution 

     <script type="text/javascript" language="javascript">         
            function loadYOX()
            {
                $("a.yoxview").yoxview();
                $("a.yoxview img").yoxview(); 
            }
    </script>

     protected void listImages_PageIndexChanged(object sender, RadListViewPageChangedEventArgs e)
            {
                BindImages(Convert.ToInt32(C));
                Page.ClientScript.RegisterStartupScript(this.GetType(), "yoxview", "loadYOX();", true);
            }

    and many other solutions but nothing seems to work. I have spent more time solving this problem than developing the web.
  7. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 07 Jun 2010 Link to this post

    Hello Vasja,

    I assume you are looking for ScriptManager.RegisterStartupScript method instead of Page.ClientScript.RegisterStartupScript.

    Regards,
    Nikolay
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Vasja Petkovska
    Vasja Petkovska avatar
    10 posts
    Member since:
    Dec 2009

    Posted 07 Jun 2010 Link to this post

    Yep it worked.

    protected void listImages_PageIndexChanged(object sender, RadListViewPageChangedEventArgs e)
    {ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "yoxview", "loadYOX()", true);}

    <script type="text/javascript" language="javascript">         
            function loadYOX()
            {
                jQuery.yoxviewUnload();
                $(".yoxview").yoxview();
            }
    </script>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017