Jan 21, 2010, 4:10 PM
[CLOSED] XRender UserControl DirectMethod
Hi Guys,
This post can be taken as in continuation to my previous post
http://forums.ext.net/showthread.php...5710-16-1.aspx
I have a user control which has a DirectMethod.
When I load that control dynamically, the direct method is not registered on the client side. Only the script for components is received.
Again it could be only with latest code base... But u may be able to confirm. try the following code...
test.aspx
This post can be taken as in continuation to my previous post
http://forums.ext.net/showthread.php...5710-16-1.aspx
I have a user control which has a DirectMethod.
When I load that control dynamically, the direct method is not registered on the client side. Only the script for components is received.
Again it could be only with latest code base... But u may be able to confirm. try the following code...
test.aspx
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script runat="server">
[DirectMethod]
public void loadControl() {
Control cw = this.LoadControl("test.ascx");
cw.ID = "cw";
panel1.ContentControls.Add(cw);
panel1.UpdateContent();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="scp1" runat="server" DirectMethodNamespace="DM"></ext:ResourceManager>
<ext:Panel runat="server" ID="panel1"></ext:Panel>
</form>
</body>
</html>
test.ascx<%@ Control Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
[DirectMethod]
public string test()
{
return "Test";
}
</script>
<ext:Button runat="server" ID="button1" Text="btn"></ext:Button>