Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Dynamic DropDownList - Retrieving the controls properties(id, selectedindex, etc...)

Reply
Thread Tools

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

 
 
aesquivel
Guest
Posts: n/a
 
      06-10-2005
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...ngcontrols.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic controls - Adding & Retrieving value Ben Amada ASP .Net 3 08-23-2010 05:37 AM
Dynamic Controls created by Dynamic Controls Ronald ASP .Net 2 01-17-2006 12:44 AM
Retrieving SelectedValue from DropDownList AlBruAn ASP .Net Datagrid Control 6 04-12-2005 03:07 PM
Dynamic Variables? OR Dynamic Controls =?Utf-8?B?VGVyb3M=?= ASP .Net 1 08-10-2004 01:13 PM
Dynamic Controls, Placeholder, Retrieve Information from Dynamic Controls Denny Smolinski via .NET 247 ASP .Net Web Controls 1 05-04-2004 09:15 PM



Advertisments