onserverclick in a usercontrol inside of a webcontrol

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Re: onserverclick in a usercontrol inside of a webcontrol

    More Info:
    In my webcontrol I am implementing the IPostBackEventHandler. I print out
    the eventArgument and I do not get anything from the usercontrol inside but
    does print out the arg from the webcontrol.
    I also tried implementing this in the usercontrol and does not reach the
    IPostBackEventHandler.RaisePostBackEvent.

    Inside RenderContents:
    UserControl usercontrol
    =(UserControl)Page.LoadControl("~/usercontrols/common/Event_Add.ascx" );
    this.Controls.Add(usercontrol);


    "John Giblin" <jwgiblin3@hotmail.com> wrote in message
    news:eosIQHQXDHA.2312@TK2MSFTNGP10.phx.gbl...
    > I have a webcontrol that dynamically adds a usercontrol. This usercontrol
    > has a form to enter data. The form tags are outside the webcontrol and
    the
    > links work like expected for the webcontrol. but the user control never
    > goes to the onserverclick event. Do I have to tell the event target or
    > something? and how do I do this.
    >
    > John
    >
    >

    John Giblin Guest

  2. Similar Questions and Discussions

    1. Event not firing in usercontrol inside usercontrol
      I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these...
    2. WebControl inside of WebControl and attaching events
      I have built a navigation custom web control that I have been placing on various pages without issue. When one of the image buttons within the...
    3. Adding a usercontrol to a WebControl
      I am trying to add a usercontrol to my webcontrol and I seem to be stuck. I see the method add in the control, but I cannot add the user control...
    4. Problem with WebControl and dynamic UserControl..
      I am trying to make a WebControl as a content panel which given the user control name and location, will create the specified user control to fill...
    5. Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
      a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use...
  3. #2

    Default Re: onserverclick in a usercontrol inside of a webcontrol

    John,

    You are adding that user control _much_ too late for it to get events. By
    the time you get to Render, everything's been decided. If you implement
    CreateUserControls, you should do it there, otherwise try moving that code
    up to OnLoad.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "John Giblin" <jwgiblin3@hotmail.com> wrote in message
    news:%23oPY$ISXDHA.3232@tk2msftngp13.phx.gbl...
    > More Info:
    > In my webcontrol I am implementing the IPostBackEventHandler. I print out
    > the eventArgument and I do not get anything from the usercontrol inside
    but
    > does print out the arg from the webcontrol.
    > I also tried implementing this in the usercontrol and does not reach the
    > IPostBackEventHandler.RaisePostBackEvent.
    >
    > Inside RenderContents:
    > UserControl usercontrol
    > =(UserControl)Page.LoadControl("~/usercontrols/common/Event_Add.ascx" );
    > this.Controls.Add(usercontrol);
    >
    >
    > "John Giblin" <jwgiblin3@hotmail.com> wrote in message
    > news:eosIQHQXDHA.2312@TK2MSFTNGP10.phx.gbl...
    > > I have a webcontrol that dynamically adds a usercontrol. This
    usercontrol
    > > has a form to enter data. The form tags are outside the webcontrol and
    > the
    > > links work like expected for the webcontrol. but the user control never
    > > goes to the onserverclick event. Do I have to tell the event target or
    > > something? and how do I do this.
    > >
    > > John
    > >
    > >
    >
    >

    John Saunders Guest

  4. #3

    Default Re: onserverclick in a usercontrol inside of a webcontrol

    Well, I don't know what the problem is, but by the time of RenderControl,
    the party's over and there's little left but the cleaning up!

    I suggest you try again, changing nothing but the location where you load
    the control and add it. In particular, watch to see if its in the postback
    list, and check to see if the name of the button is in the form data being
    posted back.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "John Giblin" <jwgiblin3@hotmail.com> wrote in message
    news:ufm4quSXDHA.2344@TK2MSFTNGP09.phx.gbl...
    > I have tried to to add the control in the CreateChildControls of the web
    > control. I still does not fire the serverClick event. Furthermore I do
    > not get the savestate of the control
    >
    > John
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    John Saunders Guest

Posting Permissions

  • You may not post new threads
  • You may 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