Dynamic DropDownList - Retrieving the controls properties(id, selectedindex, etc...)

Discussion in 'ASP .Net Building Controls' started by aesquivel, Jun 10, 2005.

  1. aesquivel

    aesquivel Guest

    This is being built on dynamicly based on what is returned from my query. Build in the LoadMain() which is called from the Page_Load. I have built a DropDownList and I am using an AddHandler to process the SelectedIndexChanged. (CODE BELOW).
    *******************************************************************
    'Add DropDown List Items for ddlFunction
    ddlFunction = New DropDownList
    ddlFunction.AutoPostBack = True
    ddlFunction.Items.Add(New ListItem("", "0"))
    ddlFunction.Items.Add(New ListItem("NONE", "n"))
    ddlFunction.Items.Add(New ListItem("ALWAYS", "a"))
    ddlFunction.Items.Add(New ListItem("MULTIPLIER", "m"))
    tr.Cells.Add(CreateDropDownListCell(ddlFunction, "ddlFunction" & strText, , 85, Css.Style.DefaultText))

    'Create AddHandler for ddlFunction
    AddHandler ddlFunction.SelectedIndexChanged, AddressOf ProcessDDLFunction
    *******************************************************************
    Problem I am running across is that when the DDL autopostback fires, it goes into the Page_Load and after it processs the LoadMain then it hits my AddHandler function.

    The main thing that I am trying to accomplish is retrieve the ddlFunction control on the AutoPostBack. Because in my LoadMain I have code that needs to run to create another dynamic control on my form. In order for me to create the new dynmic control I need to know what the user selected in the ddlFunction dropdownlist. How can I retrieve this ddlFunction control's properties(ID,Value,Index,ect) back?

    Thanks in advance for your help!

    Adrian






    From http://www.developmentnow.com/g/10_0_0_0_0_0/dotnet-framework-aspnet-buildingcontrols.htm

    Posted via DevelopmentNow.com Groups
    http://www.developmentnow.com
    aesquivel, Jun 10, 2005
    #1
    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. David Austin via .NET 247
    Replies:
    2
    Views:
    554
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  2. keithb
    Replies:
    1
    Views:
    11,950
    shauns1
    Nov 1, 2006
  3. S_K
    Replies:
    5
    Views:
    762
    Eliyahu Goldin
    Nov 14, 2007
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    383
    Fredrik Lundh
    Aug 13, 2008
  5. NancyA
    Replies:
    2
    Views:
    145
    NancyA
    Mar 28, 2005
Loading...

Share This Page