Ask a Question related to ASP.NET Building Controls, Design and Development.
-
caldera #1
Placeholder child of child control event problem.
Hi,
I have problem with placeholder which contain web user control. I want to
add user control in placeholder. For example I have a.aspx and in this page
I have a placeholder which is dynamically added web user control lets say at
a time it is added that b.ascx. In this b.ascx I have button and I have a
placeholder in this b.ascx and this placeholder contain a web user control.
When I press the button in this button which add a web user control in
b.ascx. So lets say placeholder in b.ascx at a time it added c.ascx. In this
c.ascx I have a button. My problem occur in this c.ascx button press.
I press b.ascx and it loads normally in c.ascx. That ok. But when I press
c.ascx(which loaded from b.ascx) button, its firs load a.aspx and then
b.ascx but then it doesn't load c.ascx because it load this when the button
in b.ascx. The loading procedure isnot in the page load stage, it is in the
button click stage. As a result I can't capture button click event in
c.ascx. Is it pratical way or is framework supply any tool to deal with this
kind of situtation. When the postback occur, is it possible it load child
of child control from viewstate(I don't want user ViewState.Add() )
Thanks for the answers.
caldera Guest
-
TabNavigator Child Control Problem on ProgrammaticSelectedIndex Change
I've got a TabNavigator that contains another TabNavigator as a child control on its second page. On the child TabNavigator there's a ViewStack and... -
Inherit from Table, net Catching child butten event
I'm creating a custom control Inheriting from Table and implementing INamingContainer that has a button added to a TableCell. ( public class... -
Parent/Child relations - Trying to access child control for save
I have a parent datagrid that has my customer information. For each customer I have a child datagrid with all their part information. In the... -
CustomDataGrid Child controls event problem - weird!?!
Hi, I am trying to build a Custom Web Control that extends the DataGrid control but I am having problems with the events of the child controls.... -
Composite Control - Event not firing in child control
Hello: I am experiencing an issue where I have a composite control (TestOuter) composed of more composite (TestInner) controls. When I am... -
Sam #2
Re: Placeholder child of child control event problem.
What you are saying is you have a user control in a page and when you
click its button it loads another user control with a button and then
you can't capture that second user control's button click event. Like
you say, that makes sense. The control tree for the second user
control won't be built unless you click the first button, so just
clicking the second button won't work without somehow also clicking
the first button.
One thing you could is load both the user controls on page load (which
is better for capturing form data anyhow) and simply initialize the
visibility on the second one to false. Then, on the first button's
click, set the visibility on the second one to true.
This way the control tree is always being built so you'll always
receive events for the second button click but you won't render the
second user control to html until you want to.
If you are trying for something more general than this please ask
again.
-Sam
"caldera" <caldera@nomail.com> wrote in message news:<uQzl9vBREHA.2404@TK2MSFTNGP09.phx.gbl>...> Hi,
> I have problem with placeholder which contain web user control. I want to
> add user control in placeholder. For example I have a.aspx and in this page
> I have a placeholder which is dynamically added web user control lets say at
> a time it is added that b.ascx. In this b.ascx I have button and I have a
> placeholder in this b.ascx and this placeholder contain a web user control.
> When I press the button in this button which add a web user control in
> b.ascx. So lets say placeholder in b.ascx at a time it added c.ascx. In this
> c.ascx I have a button. My problem occur in this c.ascx button press.
> I press b.ascx and it loads normally in c.ascx. That ok. But when I press
> c.ascx(which loaded from b.ascx) button, its firs load a.aspx and then
> b.ascx but then it doesn't load c.ascx because it load this when the button
> in b.ascx. The loading procedure isnot in the page load stage, it is in the
> button click stage. As a result I can't capture button click event in
> c.ascx. Is it pratical way or is framework supply any tool to deal with this
> kind of situtation. When the postback occur, is it possible it load child
> of child control from viewstate(I don't want user ViewState.Add() )
> Thanks for the answers.Sam Guest



Reply With Quote

