Adding AutoPostBack to a webcontrol

Discussion in 'ASP .Net Web Controls' started by Thomas Jespersen, Mar 24, 2006.

  1. Hi

    I have a webcontrol, which has a DropDownList and some other controls.

    I want to enable AutoPostBack on the DropDownList, but can't figure out how
    to do it.

    I tried setting myDropDownlist.AutoPostBack = true, but it doesn't make any
    differences.

    What am I missing.

    Thomas
     
    Thomas Jespersen, Mar 24, 2006
    #1
    1. Advertising

  2. Thomas Jespersen

    jeff Guest

    Are you setting the postback event on the Page Load method? Try adding it
    at the control level on the page.

    <dropdownlist autopostback=true id="ddl" runat="server" />
     
    jeff, Mar 24, 2006
    #2
    1. Advertising

  3. Re: Re:Adding AutoPostBack to a webcontrol

    Hi

    I do not have a page! It is a webcontrol in a control library (C# only), and
    the control is created programmatically. That's my problem.

    How do I set AutoPostBack on a control created programmatically?

    Thomas
     
    Thomas Jespersen, Mar 27, 2006
    #3
  4. Thomas Jespersen

    Guest

    You can turn on AutoPostBack in your control before or during your
    control's Load event.

    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)
    myDropDownlist.AutoPostBack = true
    End Sub
     
    , Mar 27, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi
    Replies:
    1
    Views:
    692
    David Waz...
    Jul 3, 2003
  2. Guest
    Replies:
    2
    Views:
    735
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    200
    Luis Ramírez
    Jul 6, 2004
  4. Jim M
    Replies:
    0
    Views:
    147
    Jim M
    Jan 14, 2004
  5. Steven

    Adding a WebControl to a WebControl

    Steven, Oct 13, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    116
    Steven
    Oct 13, 2008
Loading...

Share This Page