Page_Load called twice in Chome

13 posts, 0 answers
  1. Ankit
    Ankit avatar
    19 posts
    Member since:
    Jun 2011

    Posted 17 Jun 2011 Link to this post

    Hi

    I am not sure if this issue has been reported yet. I tried searching for it but dint find any. I am creating a simple RibbonBar in the aspx page.

    Issue 1: It works fine in IE and FF but in Chrome the Page_Load is called twice.
    Issue 2: It calls Page_Load when I click on any tab. This doesn't happen in other browsers.
    If there are any data pulls, that will happen twice.

    Aspx:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Layout_GraySkin.aspx.vb"
        Inherits="Webforms_Test_Layout_GraySkin" %>

    <%@ 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">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <link href="StyleSheet.css" rel="Stylesheet" type="text/css" />
        <link id="Link1" href="~/RadCustom/GraySkin/RibbonBar.GraySkin.css" rel="stylesheet"
            type="text/css" runat="server" />
        <link id="Link2" href="~/RadCustom/GraySkin/TabStrip.GraySkin.css" rel="stylesheet"
            type="text/css" runat="server" />
        <link id="Link3" href="~/RadCustom/GraySkin/Grid.GraySkin.css" rel="stylesheet" type="text/css"
            runat="server" />
        <link id="Link4" href="~/RadCustom/GraySkin/Menu.GraySkin.css" rel="stylesheet" type="text/css"
            runat="server" />
        <title>Layout Demo</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" CdnSettings-TelerikCdn="Disabled">
        </telerik:RadStyleSheetManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <CdnSettings TelerikCdn="Disabled" />
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all">
        </telerik:RadFormDecorator>
        <div style="margin: 0 auto; width: 1000px;">
            <div style="background-position: right; background-repeat: repeat-y; background-image: url('../../Images/HP_TOPRIGHTCORNER.png');
                height: 13px;">
            </div>
            <div id="Content" style="min-height: 600px; background-position: right; background-image: url('../../Images/HP_RIGHT.png');
                background-repeat: repeat-y; border-left: 1px solid #666666; background-color: #FFFFFF">
                <div style="position: relative;">
                                
                </div>
                <div style="width: 992px;">
                    <telerik:RadRibbonBar ID="RRB" runat="server" Skin="GraySkin" EnableEmbeddedSkins="False"
                        Height="110px">
                        <telerik:RibbonBarTab Text="Home">
                            <telerik:RibbonBarGroup Text="Clipboard" EnableLauncher="true">
                                <Items>
                                    <telerik:RibbonBarMenu Size="Large" Text="Paste" ImageUrl="../../Images/16x16/add.png">
                                        <Items>
                                            <telerik:RibbonBarMenuItem Text="Paste" ImageUrl="../../Images/16x16/add.png" />
                                            <telerik:RibbonBarMenuItem Text="Paste Special..." ImageUrl="../../Images/16x16/add.png" />
                                        </Items>
                                    </telerik:RibbonBarMenu>
                                    <telerik:RibbonBarButton Size="Medium" Text="Cut" ImageUrl="../../Images/16x16/add.png" />
                                    <telerik:RibbonBarButton Size="Medium" Text="Copy" ImageUrl="../../Images/16x16/add.png" />
                                    <telerik:RibbonBarButton Size="Medium" Text="Format" ImageUrl="../../Images/16x16/add.png" />
                                </Items>
                            </telerik:RibbonBarGroup>
                        </telerik:RibbonBarTab>
                        <telerik:RibbonBarTab Text="Insert">
                            <telerik:RibbonBarGroup Text="Links">
                                <Items>
                                    <telerik:RibbonBarButton Size="Medium" Text="Hyperlink" ImageUrl="../../Images/16x16/add.png" />
                                    <telerik:RibbonBarButton Size="Medium" Text="Bookmark" ImageUrl="../../Images/16x16/add.png" />
                                    <telerik:RibbonBarButton Size="Medium" Text="Cross-reference" ImageUrl="../../Images/16x16/add.png" />
                                </Items>
                            </telerik:RibbonBarGroup>
                        </telerik:RibbonBarTab>
                    </telerik:RadRibbonBar>
                </div>
        
            </div>
        </div>
        </form>
    </body>
    </html>

    VB:

    Partial Class Webforms_Test_Layout_GraySkin
        Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        End Sub
    End Class

    Any help will be greatly appreciated!

    Thanks
    Ankit
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Jun 2011 Link to this post

    Hello Ankit,

    Could you, please, try the latest internal build (the one uploaded yesterday), because a similar issue was reported and fixed.

    Please, let me know the result.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ankit
    Ankit avatar
    19 posts
    Member since:
    Jun 2011

    Posted 22 Jun 2011 Link to this post

    Hi Nikolay

    Thanks for your reply. I upgraded to the latest build (2011.1.621.35) but the problem is still there.

    One more thing to note is the Page_Load is called when we select a tab for the first time alone. Subsequent selections of tabs do not call  Page_Load which is normal.

    P.S: Chrome version is 12.0
  5. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 27 Jun 2011 Link to this post

    Hi Ankit,

    We have fixed the issue, please try using the next Latest Internal Build (should be out sometime tomorrow).


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 01 Jul 2011 Link to this post

    Nikola,
    I believe I am seeing the same thing with the RadTabStrip control. I have a MasterPage with a content page that contains a RadTabStrip containing 5 tabs. I am using the following code to load the associated user control into the selected tab.

    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
    {
        string _userControlName = string.Format("/Controls/{0}.ascx", e.PageView.ID);
         Control _userControl = Page.LoadControl(_userControlName);
        _userControl.ID = e.PageView.ID + "_userControl";
         e.PageView.Controls.Add(_userControl);
    }

    In the Page_Init of the control I build the DataGrid based on a defined .cs file for the grid definition. I am trying to tune the application and what I am seeing is that when I click a desired tab the currently selected tab fires off the Page_Init of the tab loosing focus before it fires the Page_Init of the selected tab. Is this normal?

    ~Tim
  7. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 01 Jul 2011 Link to this post

    Let me further clarify after noting some additional things. This sample code is being used so indeed there is no postback after all tabs have been initially loaded however, as each tab is clicked the first time there is a postback to every control for every tab.

    Also if I click the refresh button of a RadDataGrid in a tab, all RadDataGrids are recreated and populated even if it is not the grid I am working with.
  8. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 06 Jul 2011 Link to this post

    Hi Tim,

    If I understood correctly, the problem you experience is that all the tabs are binded, and you need only the selected tab to be bound.

    If this is the case, there isn't a complete solution for it - the controls declared on a page will always be recreated server-side. But you can reduce the rendered output, though - there is a property of RadMultiPage that you could use RenderSelectedPageOnly.

    I hope this helps.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  9. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 06 Jul 2011 Link to this post

    I tried RenderSelectedPageOnly but when I try to go back to a tab no data is displayed.
  10. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 08 Jul 2011 Link to this post

    Hello Tim,

    Please, open a support ticket and send us a simple runnable sample reproducing the problem.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  11. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 14 Jul 2011 Link to this post

    I seem to be having the same or a similar problem, though I am using IE8. 

    I have a page which contains a usercontrol.  This usercontrol has a RadTabStrip and uses Page.LoadControl to load other usercontrols into PageViews.  The Page_Load event in the loaded usercontrol is being fired twice.

    Do you think this issue would also be fixed in the latest build?
  12. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 18 Jul 2011 Link to this post

    Hi Craig,

    I don't think so. The issue we discovered is isolated in RadRibbonBar.

    @Ankit, we have made another fix for the issue and currently we are not aware of scenario in which it reproduces. You will be able to get the change in the next Latest Internal Build. Please, provide a feedback on whether the issue reproduces at your end.

    I hope this will finally resolve the issue you experienced.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  13. Ankit
    Ankit avatar
    19 posts
    Member since:
    Jun 2011

    Posted 18 Jul 2011 Link to this post

    Hi Nikolay

    Thanks a lot. I will try the new build and give you feedback once I do it.
  14. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 18 Jul 2011 Link to this post

    Hi Nikolay,

    Yes, it was an issue at my end.  I don't have the problem anymore.

    Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017