Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Urbal #1
Need help persisting a dynamically loaded userControl...
Ok, I've done quite a bit of testing and am stuck. Here's the
situation, I have two userControls and my webForm page.
menu.ascx - menu
contentEditor.ascx - input box + button
desktopDefault.aspx - blank, except menu.ascx userControl loaded
menu.ascx - obviously contains my menu, a selection of choices... when
the user clicks the "content editor" menu option, I load
contentEditor.ascx dynamically on desktopDefault.aspx by accessing the
<form> on the page and loading my control.
Now loading works just fine, but when I try to run my button_event from
contentEditor.ascx, it never fires. So far I have noticed that when I
click my "save" button on contentEditor.ascx, it does a few things:
--> Reloads DesktopDefault.aspx
--> Reloads menu.ascx
Now when it reloads menu.ascx, I lose the dynamically built control
contentEditor.ascx, which is why the button event never fires. My
question is, how do I maintain the contentEditor control on
desktopDefault.aspx and tell menu.ascx to again load my pre-selected
choice?
Any help is greatly appreciated. Thanks in advance.
-e
Urbal Guest
-
dynamically add usercontrol
Hi Can anybody explain to me how to dynamically add a usercontrol? When I try to use the this.Controls.Add the control is added, but none of the... -
Dynamically loaded text file
When a page is uploaded in Contribute 3, it also uploads dependent files attached to it: images, pdf's, etc. My question is, does it also upload... -
Dynamically added usercontrol raised events
I've tried and tried and this problem eludes me. I have a form called "main" which has a div tag "DeptInfo" in which I add my control... -
UserControl not capturing Button click event when loaded with PlaceHolder Control
My UI is one table, 2 colums, one row. The cell on the left has a tree and the cell on the right has a placeholder control. When the user clicks on... -
Event not firing. Adding controls dynamically to UserControl
I am adding controls to the UserControl dynamically and then loading the UserControl Dynamically.But I am facing problem with firing of click event... -
Brock Allen #2
Re: Need help persisting a dynamically loaded userControl...
When you dynamically add controls into the page it is up to you to recreate
them upon postback. The two places to do this is in Page_Init or CreateChildControls.
If you're doing this from a user control you can also do this from Page_Load.
The challenge is storing the necessary state information to remember what
controls to add.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Ok, I've done quite a bit of testing and am stuck. Here's the
> situation, I have two userControls and my webForm page.
>
> menu.ascx - menu
> contentEditor.ascx - input box + button
> desktopDefault.aspx - blank, except menu.ascx userControl loaded
> menu.ascx - obviously contains my menu, a selection of choices... when
> the user clicks the "content editor" menu option, I load
> contentEditor.ascx dynamically on desktopDefault.aspx by accessing the
> <form> on the page and loading my control.
>
> Now loading works just fine, but when I try to run my button_event
> from
> contentEditor.ascx, it never fires. So far I have noticed that when I
> click my "save" button on contentEditor.ascx, it does a few things:
> --> Reloads DesktopDefault.aspx
> --> Reloads menu.ascx
> Now when it reloads menu.ascx, I lose the dynamically built control
> contentEditor.ascx, which is why the button event never fires. My
> question is, how do I maintain the contentEditor control on
> desktopDefault.aspx and tell menu.ascx to again load my pre-selected
> choice?
>
> Any help is greatly appreciated. Thanks in advance.
>
> -e
>
Brock Allen Guest



Reply With Quote

