PDA

View Full Version : [CLOSED] Control with type 'Ext.Net.XScript' cannot be handled by layout



michaeld
Apr 24, 2013, 8:29 AM
I have a UserControl containing a TaskManager and related XScript. I cannot seem to get this control to render in a Bin, HtmlBin, Items or any layout without this exception. I had no problem with this control rendering in 1.X but no idea how to solve the issue in 2.X. I consider this a bug as opposed to a enhancement request. Please ideas?

Daniil
Apr 24, 2013, 9:26 AM
Hi @michaeld,

1. Bin

We have a ticket "A possibility to put a UserControlLoader into a Bin collection".
https://github.com/extnet/Ext.NET/issues/198

After implementing this feature it should be possible to put such a user control into a UserControlLoader, then put it to a Bin collection.

2. Items

I think it is incorrect to render such a user control to an Items collection, because a TaskManager is not a component to participate in layouting.

3. HtmlBin

It appears to be working.

Example Page

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/TestUC.ascx" TagPrefix="uc" TagName="TectUC" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Container runat="server">
<HtmlBin>
<uc:TectUC runat="server" />
</HtmlBin>
</ext:Container>
</form>
</body>
</html>


Example User Control

<%@ Control Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<ext:XScript runat="server">
<script>
var onUpdate = function () {
console.log(#{TaskManager1});
};
</script>
</ext:XScript>

<ext:TaskManager ID="TaskManager1" runat="server">
<Tasks>
<ext:Task AutoRun="true" Interval="2000">
<Listeners>
<Update Fn="onUpdate" />
</Listeners>
</ext:Task>
</Tasks>
</ext:TaskManager>

michaeld
Apr 24, 2013, 9:57 AM
Your example has it in bin.

Daniil
Apr 24, 2013, 11:31 AM
Sorry, corrected.