retrieving a dynamic dropdownlist value in an asp table

Recommended Answers

All 3 Replies

I'm not sure what you mean. If you want to create a list from dynamic data or get data from a dynamic list?
From data to list...
<html><body><form>
<asp:ListBox ID="ListBox1" runat="server></asp:ListBox>
</form></body></html>

protected void page_load(object sender, EventArgs e)
{
// Defining DataSources is very large in scope but to get a list of roles that a user is a
//member of, assuming you have a role provider setup with asp...
ListBox1.DataSource = Roles.GetAllUserRoles(User.Identity.Name);
ListBox1.DataBind();
}

I assume you could bind a list box to any field in any table provided they are set up as a provider. I'm not really sure how to do it though, something about stored procedures?

From list to data...
First define your dynamic control(MSDN search for create dynamic controls).
The create a class that tests for the controls existance. If the control exist then convert its data to an array and work with it from there. Here is another discussion about this. http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic59930.aspx
Give us some more detail for a more detailed answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.