I have created a custom user control that will be resused on several pages in an application. The user control is unique because to start with, it contains no controls or content. All the content is created dynamically. Herein lies the problem I am having.
On a normal page in the app - in the code behind - I am dynamically creating an instance of my user control. In the page load method of the user control, I am dynamically creating content.
Here is a simplified scenario of what I am trying to create inside the user control: 1 table with 1 row that contains 1 cell that contains a text box and a masked edit extender. Everything was working fine until I added a masked edit extender for the text
box. For some reason, when I add a dynamic masked edit extender to the cell.controls collection, at runtime, the masked edit extender cannot find the targetcontrol (which I specified correctly). Any ideas what I'm doing wrong or how to accomplish this?
Thanks,
Mike
UserControluser controlcontrolcustom controlasp.net 2.0user control contentAJAXajax webcontrolusercontrol eventsControlspage load
MrMooseAZ
0 Points
1 Post
Help with user control
Jun 26, 2007 05:07 AM|LINK
Hey all,
I have created a custom user control that will be resused on several pages in an application. The user control is unique because to start with, it contains no controls or content. All the content is created dynamically. Herein lies the problem I am having. On a normal page in the app - in the code behind - I am dynamically creating an instance of my user control. In the page load method of the user control, I am dynamically creating content.
Here is a simplified scenario of what I am trying to create inside the user control: 1 table with 1 row that contains 1 cell that contains a text box and a masked edit extender. Everything was working fine until I added a masked edit extender for the text box. For some reason, when I add a dynamic masked edit extender to the cell.controls collection, at runtime, the masked edit extender cannot find the targetcontrol (which I specified correctly). Any ideas what I'm doing wrong or how to accomplish this?
Thanks,
Mike
UserControl user control control custom control asp.net 2.0 user control content AJAX ajax webcontrol usercontrol events Controls page load