Professional Web Applications Themes

Placeholder child of child control event problem. - ASP.NET Building Controls

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 ...

  1. #1

    Default 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

  2. #2

    Default 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" <calderanomail.com> wrote in message news:<uQzl9vBREHA.2404TK2MSFTNGP09.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

Similar Threads

  1. TabNavigator Child Control Problem on ProgrammaticSelectedIndex Change
    By jonwillis in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 3rd, 09:42 PM
  2. Parent/Child relations - Trying to access child control for save
    By tnt_lu@hotmail.com in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: April 15th, 12:50 PM
  3. CustomDataGrid Child controls event problem - weird!?!
    By YunusEmre in forum ASP.NET Building Controls
    Replies: 3
    Last Post: December 22nd, 01:39 PM
  4. Composite Control - Event not firing in child control
    By Chris Simmons in forum ASP.NET Building Controls
    Replies: 3
    Last Post: October 28th, 09:45 PM
  5. Replies: 1
    Last Post: April 8th, 11:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139