Datalists refreshing

G

Guest

Hello.

I have a drop down list (DDList) and a Data List (DataList) on a page.

When I choose something from the Drop Down List (it lists States) the
datalist changes to display all the people in that State.

This works great, however, I want a textbox at the top to display how many
people it has returned eg "Found 88 people" or "No one listed here"

Now I have the following code:

<script runat ="Server" language="vbscript">

Sub DataList_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles DataList.DataBinding
If Me.DataList.Items.Count < 1 Then
Me.txtmembercount.Text = "No People To Show"
Else
Me.txtmembercount.Text = Me.DataList1.Items.Count
End If
End Sub
</script>

The problem is that it seems to count for the previous dropdown list value.
Is there a way that I can get it to count the Items after it has refreshed
the DataList and not before?

Many thanks

James
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top