Oct 22, 2010, 8:03 AM
[CLOSED] [1.0] Load dynamic UserControl with Coolite Controls.
Hi again,
I'm trying to load a user control with coolite components on a button click event, and it does perfectly.
Well, inside this user control there are a button and a textfield, and here is the problem, when I click in ButtonTest_Click appears this sweet error :confused:
The control with ID 'ctl07_ButtonNew' not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The control with ID 'ctl07_ButtonNew' not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The control with ID 'ctl07_ButtonNew' not found]
Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1123
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Here is the example:
WebForm1.aspx
-------------------
-----------------------
-------------------------
------------------------------
FVNoel
I'm trying to load a user control with coolite components on a button click event, and it does perfectly.
Well, inside this user control there are a button and a textfield, and here is the problem, when I click in ButtonTest_Click appears this sweet error :confused:
The control with ID 'ctl07_ButtonNew' not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The control with ID 'ctl07_ButtonNew' not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The control with ID 'ctl07_ButtonNew' not found]
Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1123
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Here is the example:
WebForm1.aspx
-------------------
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="ButtonNewWindow" runat="server" Text="New Window">
<DirectEvents>
<click onevent="ButtonNewWindow_Click">
<EventMask ShowMask="true" MinDelay="1000" />
</click>
</DirectEvents>
</ext:Button>
</div>
</form>
</body>
</html>
WebForm1.aspx.vb-----------------------
Imports Ext.Net
Public Class WebForm1
Inherits Global.System.Web.UI.Page
Protected Sub ButtonNewWindow_Click(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
Dim newW As New Ext.Net.Window
newW.ID = "WIN"
newW.Width = 200
newW.Height = 200
newW.Title = "Test"
Dim uControl As UserControl = LoadControl("WebUserControl1.ascx")
newW.ContentControls.Add(uControl)
Me.Controls.Add(newW)
newW.Render()
End Sub
End Class
WebUserControl1.ascx-------------------------
<ext:Button ID="ButtonNew" runat="server" Text="Submit">
<DirectEvents>
<click onevent="ButtonTest_Click" StopPropagation="true">
<EventMask ShowMask="true" MinDelay="1000" />
</click>
</DirectEvents>
</ext:Button>
<ext:TextField ID="TextField1" runat="server">
</ext:TextField>
WebUserControl1.ascx.vb------------------------------
Public Class WebUserControl1
Inherits Global.System.Web.UI.UserControl
Protected Sub ButtonTest_Click(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
Me.TextField1.Text = "TEST"
End Sub
End Class
Could you help me?FVNoel
Last edited by Daniil; Oct 22, 2010 at 5:27 PM.
Reason: [CLOSED]