J
jmhmaine
Overview:
I have a page that displays 24 email newsletters that a user can subscribe
to by clicking checking the a check for each one. These fall into different
categories, currently 5, but this can change. The data is stored in two
tables, one called Family which contains the categories, the other is
Projects, which contains the individual newsletters items. Family and
Projects have a one-to-many relationship.
Goal:
What I want to display is:
<Category Name 1>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
<Category Name 2>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
<Category Name X>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
[Submit]
Each newsletter topic has a checkbox before it, so the user can select which
topics interest them. This form needs to display the current selections, so
the user can view the topics already selected.
Currently I have the following in the code behind page in VB.NET, which only
lists all 24 topics, without the Category name:
Dim da As SqlDataReader
Dim sqlStr As String
sqlStr = "SELECT ProjectID, EmailTopic FROM vEmailTopics"
da = SqlHelper.ExecuteReader(Global.ConnectionString,
CommandType.Text, sqlStr)
cblEmailList.DataSource = da
cblEmailList.DataValueField = "ProjectID"
cblEmailList.DataTextField = "EmailTopic"
cblEmailList.DataBind()
How do I achive the desired goal? Thanks.
I have a page that displays 24 email newsletters that a user can subscribe
to by clicking checking the a check for each one. These fall into different
categories, currently 5, but this can change. The data is stored in two
tables, one called Family which contains the categories, the other is
Projects, which contains the individual newsletters items. Family and
Projects have a one-to-many relationship.
Goal:
What I want to display is:
<Category Name 1>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
<Category Name 2>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
<Category Name X>
[] Newsletter Topic 1
[] Newsletter Topic 2
[] Newsletter Topic X
[Submit]
Each newsletter topic has a checkbox before it, so the user can select which
topics interest them. This form needs to display the current selections, so
the user can view the topics already selected.
Currently I have the following in the code behind page in VB.NET, which only
lists all 24 topics, without the Category name:
Dim da As SqlDataReader
Dim sqlStr As String
sqlStr = "SELECT ProjectID, EmailTopic FROM vEmailTopics"
da = SqlHelper.ExecuteReader(Global.ConnectionString,
CommandType.Text, sqlStr)
cblEmailList.DataSource = da
cblEmailList.DataValueField = "ProjectID"
cblEmailList.DataTextField = "EmailTopic"
cblEmailList.DataBind()
How do I achive the desired goal? Thanks.