Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack

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

  1. #1

    Default 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 Loadcontrol("test.ascx") in a aspx fiel's Page_Load event the
    dropdownlist which in the ascx can not run good it can not autopostback and
    can not call the OnselectedChange event. help me pls~~


    huobazi Guest

  2. Similar Questions and Discussions

    1. Howto load a usercontrol from App_Code
      For the last ½ year i've been looking for a way to load my usercontrols at runtime from different pages using a standard. I know i can reference...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack

    I assume you are using a dynamic control--

    Be SURE the control exists when you post back to your page.
    if the control doesn't exist when the page posts back, it
    cannot receive the vent.

    so, load the control regardless of the value
    of "IsPostBack".

    2ndly, do you add a handler when the control is first
    rendered? you need to assign some routine to handle the
    event:

    AddHandler myControl.MyEvent Addressof MyEventHandler
    unless you are using member-level "WithEvents" variable
    for your control.
    >-----Original Message-----
    >a uscontrol test.ascx have a dropdownlist web control the
    dropdownlist's
    >AutoPostBack property is set "true"
    >but when i use Loadcontrol("test.ascx") in a aspx fiel's
    Page_Load event the
    >dropdownlist which in the ascx can not run good it can
    not autopostback and
    >can not call the OnselectedChange event. help me pls~~
    >
    >
    >.
    >
    David Waz... 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