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

Page_Load called twice in Chome

12 Answers 677 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Ankit
Top achievements
Rank 1
Ankit asked on 17 Jun 2011, 05:29 PM
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

12 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 22 Jun 2011, 09:35 AM
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.

0
Ankit
Top achievements
Rank 1
answered on 22 Jun 2011, 04:57 PM
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
0
Nikolay Tsenkov
Telerik team
answered on 27 Jun 2011, 10:53 AM
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.

0
Tim
Top achievements
Rank 2
answered on 01 Jul 2011, 05:29 PM
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
0
Tim
Top achievements
Rank 2
answered on 01 Jul 2011, 06:46 PM
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.
0
Nikolay Tsenkov
Telerik team
answered on 06 Jul 2011, 08:23 AM
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!

0
Tim
Top achievements
Rank 2
answered on 06 Jul 2011, 02:40 PM
I tried RenderSelectedPageOnly but when I try to go back to a tab no data is displayed.
0
Nikolay Tsenkov
Telerik team
answered on 08 Jul 2011, 08:17 AM
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!

0
Craig Wallace
Top achievements
Rank 1
answered on 14 Jul 2011, 05:28 PM
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?
0
Nikolay Tsenkov
Telerik team
answered on 18 Jul 2011, 04:06 PM
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!

0
Ankit
Top achievements
Rank 1
answered on 18 Jul 2011, 04:10 PM
Hi Nikolay

Thanks a lot. I will try the new build and give you feedback once I do it.
0
Craig Wallace
Top achievements
Rank 1
answered on 18 Jul 2011, 04:12 PM
Hi Nikolay,

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

Thanks.
Tags
TabStrip
Asked by
Ankit
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Ankit
Top achievements
Rank 1
Tim
Top achievements
Rank 2
Craig Wallace
Top achievements
Rank 1
Share this question
or