PDA

View Full Version : call .ascx



corsaronero
Mar 18, 2012, 6:58 PM
Hi,
I have the problem with call file .ascx with visibiliti not work
how can I do ? Thanks

File Index.aspx

<body>
<form id="Form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel
ID="DashBoardPanel"
runat="server"
Cls="items-view"
Layout="fit"
AutoHeight="true"
Width="800"
Border="false">
<Items>
<ext:DataView
ID="Dashboard"
runat="server"
StoreID="Store1"
SingleSelect="true"
OverClass="x-view-over"
ItemSelector="div.item-wrap"
AutoHeight="true"
EmptyText="No items to display">
<DirectEvents>
<SelectionChange OnEvent="buttonOpenWind">
</SelectionChange>
</DirectEvents>
</ext:DataView>
</Items>
</ext:Panel>
<uc4:WindowEditor ID="Customers" runat="server" Visible ="false"/>

</form>
</body>

File Index.cs

[DirectMethod]
protected void buttonOpenWind(object sender, DirectEventArgs e)
{
Customers.Visible = true;

}

Daniil
Mar 19, 2012, 8:19 AM
Hi,

Please follow:
http://forums.ext.net/showthread.php?13114

corsaronero
Mar 19, 2012, 12:27 PM
sorry but I did not understand the explanation


Control headerControl = (Control)LoadControl("Customers.ascx");
PlaceHolder1.Controls.Add(headerControl);

I tried to load the control but does not work so someone can give me a solution please?

Daniil
Mar 21, 2012, 3:32 PM
Forget my post, I didn't notice that you use the Visible property of a user control.

Anyways, changing Visible during DirectEvent doesn't make sense.

Please see the example how to load user controls dynamically.
http://examples1.ext.net/#/XRender/UserControl/UpdateContent/

Daniil
Mar 21, 2012, 3:35 PM
I've just noticed the thread is on the Help 2.x forum. Could you confirm you use Ext.NET v2?