Dynamic controls button event in vb.net 2005

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

  1. #1

    Default Dynamic controls button event in vb.net 2005

    I have created a control with some label, textbox and Button. On the click
    of the button the entries in textbox on the control is validated and a
    database table is updated. The button click event works when the
    control is placed directly on the panel from design window but not when i
    use
    programming to load the control.
    I need to be able to load the control dynamically into panel as this depends
    on some selection user does in main window.

    Here's how i load the control into panel:

    panel1.controls.add(page.loadcontrol("MyControl.as cx"))

    Thanks for help

    Sushil




    sushil prasad Guest

  2. Similar Questions and Discussions

    1. Dynamic User Controls Event Handling
      In my web form to the place holder i'm loading different User Controls depends on some conditions for the user control which is loaded first time...
    2. Dynamic User Controls Event Handling Problem
      I've three user control 1,2 in the web form i had a place holder control to that place holder i'm loading either 1 or 2 depending on some...
    3. Event not firing.adding dynamic controls 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...
    4. Dynamic Controls & Event Notifications
      Here's a reply to another, related post: The subject of the post is "viewstate question", if you want to find the thread... HTH. -----...
    5. Dynamic Controls & Event Notifications -- Correction
      "Jason Turim" <leisuretimeindustries@hotmail.com> wrote in message news:uVWAZX%23SDHA.3088@TK2MSFTNGP10.phx.gbl... rows. but textboxes
  3. #2

    Default Re: Dynamic controls button event in vb.net 2005

    That's depends on where you are adding the control.

    If you're adding it in CreateChildControls, it would work!


    --
    Happy Hacking,
    Gaurav Vaish | [url]www.mastergaurav.com[/url]
    [url]www.edujinionline.com[/url]
    [url]http://eduzine.edujinionline.com[/url]
    -----------------------------------------


    "sushil prasad" <sushil@dccnet.com> wrote in message
    news:12lngnr1pt2vk14@corp.supernews.com...
    >I have created a control with some label, textbox and Button. On the click
    > of the button the entries in textbox on the control is validated and a
    > database table is updated. The button click event works when the
    > control is placed directly on the panel from design window but not when i
    > use
    > programming to load the control.
    > I need to be able to load the control dynamically into panel as this
    > depends
    > on some selection user does in main window.
    >
    > Here's how i load the control into panel:
    >
    > panel1.controls.add(page.loadcontrol("MyControl.as cx"))
    >
    > Thanks for help
    >
    > Sushil
    >
    >
    >
    >

    Gaurav Vaish \(www.EdujiniOnline.com\) Guest

  4. #3

    Default Re: Dynamic controls button event in vb.net 2005

    Postback on dynamically created controls only works on two conditions:
    1) the control needs to be dynamically added again AFTER the postback as
    well (this is obvious, but may be forgotten!)
    2) the control should have exactly the same ID as before the postback. If
    the number of controls after the postback has changed, and the ID's are
    assigned by the ASP.NET server automatically, this may cause an ID mismatch
    and therefore postback failure. Either make sure that the number of controls
    is the same, or that you force the same ID on the control as before the
    postback.

    I hope this helps...

    --

    Riki

    "sushil prasad" <sushil@dccnet.com> wrote in message
    news:12lngnr1pt2vk14@corp.supernews.com...
    >I have created a control with some label, textbox and Button. On the click
    > of the button the entries in textbox on the control is validated and a
    > database table is updated. The button click event works when the
    > control is placed directly on the panel from design window but not when i
    > use
    > programming to load the control.
    > I need to be able to load the control dynamically into panel as this
    > depends
    > on some selection user does in main window.
    >
    > Here's how i load the control into panel:
    >
    > panel1.controls.add(page.loadcontrol("MyControl.as cx"))
    >
    > Thanks for help
    >
    > Sushil
    >
    >
    >
    >

    Riki 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