PDA

View Full Version : [CLOSED] Panel Contect Load from Code Behind



HOWARDJ
Jun 20, 2013, 5:11 PM
I'm trying to programmatically set panel content from the code behind. I've tried the below code but it does not render and it does not give me an error.

Code Behind


Public Sub Test_Load(ByVal sender As Object, ByVal e As DirectEventArgs)
Panel9.RemoveAll()
Dim ldr As New ComponentLoader
ldr.Url = "http://ext.net"
ldr.Mode = LoadMode.Frame
'ldr.DisableCaching = True
Panel9.Loader = ldr

End Sub



ASPX Codes




<ext:Panel ID="Panel9" runat="server" Layout="FitLayout" Title="Center">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="Button1" runat="server" Text="Load with Html Mode">
<DirectEvents>
<Click OnEvent="Test_Load">
</Click>
</DirectEvents>
</ext:Button>

</Items>
</ext:Toolbar>
</TopBar>
<Loader ID="Loader1" runat="server" DisableCaching="true" Url="/webform3.aspx" Mode="Frame"
Renderer="" AutoLoad="true">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>

Daniil
Jun 20, 2013, 7:29 PM
Hi @HOWARDJ,

Please use the LoadContent method.

Example (C#)

this.Panel1.LoadContent("http://ext.net");

HOWARDJ
Jun 20, 2013, 9:09 PM
Perfect, that fixed the problem.