View Full Version : [CLOSED] ASPX ---> ASCX ---> ASCX (in Windows) :: Open new Windows with dynamic ASCX

Dec 06, 2014, 8:51 AM

I have an ASPX page (WebForm1) that loads dinamically a ASCX control (WebUserControl1).
In this ASCX (WebUserControl1), I want show a modal Window that show a second ASCX control (Test) inside.

Can you help me?

The code:


<%@ Page Language="vb" %>

<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim Applicazione As New Ext.Net.UserControlLoader
Applicazione.ID = "Applicazione1"
Applicazione.Path = "WebUserControl1.ascx"
End Sub

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<form id="form1" runat="server">

<ext:ResourceManager runat="server" ID="ResourceManager1" />

<ext:Viewport runat="server" ID="Viewport1">
<ext:VBoxLayoutConfig Align="Center" />

<ext:Panel ID="PanelApplicazione" runat="server" Flex="1" Width="1000" Border="false" PaddingSpec="5 0 5 0" Layout="FitLayout" />




<%@ Control Language="vb" %>

<script runat="server">
Protected Sub Button1_Click(sender As Object, e As Ext.Net.DirectEventArgs)
Dim Controllo As New Ext.Net.UserControlLoader
Controllo.ID = "Test1"
Controllo.Path = "Test.ascx"

Dim Finestra As New Ext.Net.Window
Finestra.ID = "FinestraTest1"

End Sub

<ext:Panel ID="Panel1" runat="server">
<ext:Button runat="server" ID="Button1" IDMode="Static" Text="GO !">
<Click OnEvent="Button1_Click" />


<%@ Control Language="vb" %>

<ext:Panel ID="Panel1" runat="server" >
<ext:Label runat="server" ID="Label1" Text="Hello World !" />

If you run the code and click on "GO !" it should show a modal window with the label "Hello World !" ... but nothing appears.

Dec 07, 2014, 10:00 PM
Hi Mario,

I want show a modal Window that show a second ASCX control (Test) inside.

As far as I can understand you try to show it somehow. So, what does happen with your attempt? Does it not work? Is there any error or exception thrown?

Also I would like to recommend you to use

<script runat="server">
for code behind. It would help to provide us with standalone examples which we can easily copy, paste and run without any changes from our side.

In this case for the Page directive you should leave only the Language setting.

<%@ Page Language="VB" %>

Please see Example (Very Helpful) here.
Forum Guidelines For Posting New Topics (http://forums.ext.net/showthread.php?3440)

We would appreciate if you edit the code samples in the original post.

Dec 08, 2014, 8:16 AM
I edited the original post.
I await the help.
Thanks Danill.

Dec 08, 2014, 1:14 PM
Thank you.

You should also render a Window.

Protected Sub Button1_Click(sender As Object, e As Ext.Net.DirectEventArgs)

End Sub

See also

Dec 08, 2014, 1:43 PM
Thank you Danill.
Problem solved: you're always very helpful!