PDA

View Full Version : [CLOSED] TabPanel Ajax Loading Problem



chulcy
May 29, 2014, 8:33 PM
Hello,

I'm trying to use the Loader URL functionality of a TabPanel to load the contents of a panel via another .aspx page.
I can step through the code to see that the child .aspx page is getting called and should be rendering, but it doesn't.
I have a create a small sample to demonstrate the problem (just click on Tab2).
I appreciate any help you can give me.

Contents of "tabpaneltest.aspx"


<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Ext.Net.X.IsAjaxRequest)
this.pnlTest1.Title = "TabPanel 1";
}
</script>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>TabPanel Test</title>
</head>
<body>
<ext:ResourceManager ID="rm1" runat="server" />
<form id="form1" runat="server">
<ext:Viewport ID="Viewport1" runat="server" StyleSpec="background-color: transparent;" Layout="BorderLayout">
<Items>
<ext:TabPanel
ID="TabPanel1"
Region="Center"
runat="server"
ActiveTabIndex="0" >
<Items>
<ext:Panel
ID="Tab1"
runat="server"
Title="Tab1"
Layout="Fit">
<Items>
<ext:Panel ID="pnlTest1" runat="server" AutoScroll="true">
</ext:Panel>
</Items>
</ext:Panel>
<ext:Panel
ID="Tab2"
runat="server"
Title="Tab2"
Layout="Fit">
<Loader runat="server" Url="paneltest.aspx">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>


Contents of "paneltest.aspx"


<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Ext.Net.X.IsAjaxRequest)
this.pnlTest2.Title = "TabPanel 2";
}
</script>
<ext:ResourceManager ID="rm1" runat="server" />
<ext:Panel ID="pnlTest2" runat="server" AutoScroll="true">
</ext:Panel>

Daniil
May 30, 2014, 6:06 AM
Hi @chulcy,

To load another page into some page you should use Mode="Frame" for a Loader. It renders a page in an iframe.

chulcy
May 30, 2014, 4:32 PM
Thanks Daniil, that worked!
Just renewed my support subscription for another year!

I really don't like the thought of an iframe, is there a better or more preferred way to do this?

Craig

Daniil
May 30, 2014, 5:10 PM
Just renewed my support subscription for another year!

Had you just 3 posts before renewal? You are just an ideal customer!:)



I really don't like the thought of an iframe, is there a better or more preferred way to do this?


It is a good point. IMO, they should be used only if there is really a very good reason.

Though, I would say there is no another way to load a full page into another. I would recommend you to consider a possibility to use UserControls.
http://examples2.ext.net/#/Loaders/Component/Direct_Method/