DropDownList Looses Items when Browser Page is Refreshed

M

m_evergreen

I have a drop down which is pulling its values from a table, populated
by database which is behaving very strangely. If the browser page is
refreshed it becomes empty and will never repopulate. The box is
populated on load with the following code, which I've added some
likely useless commands to in an attempt to fix this problem:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If IsPostBack = False Then
pop()
Else
Me.lblReg.Text = ""
Me.lblUnl.Text = ""
table2.Reset()
myzone = ""
End If

Private Sub pop()
Me.ddlArea.DataSource = ""
Me.ddlArea.DataTextField = ""
Me.ddlArea.DataBind()
table.Reset()
Me.SqlSelectCommand1.Parameters.Item("@pack").Value = package
Try
Me.sqlDAVoipPlan.Fill(table)
Catch ex As Exception
myerror = ex.Message & "DAVoipPlan"
onmyerror()
End Try
Me.ddlArea.DataSource = table
Me.ddlArea.DataTextField = "FinalPattern"
Me.ddlArea.DataBind()
Me.ddlArea.Items.Insert(0, New ListItem("", "Empty"))
End Sub
 
B

Bob Barrows

m_evergreen said:
I have a drop down which is pulling its values from a table, populated
by database which is behaving very strangely. If the browser page is
refreshed it becomes empty and will never repopulate. The box is
populated on load with the following code, which I've added some
likely useless commands to in an attempt to fix this problem:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

You're definitely in the wrong newsgroup. I suspect this is .Net code, so
you should be posting in one of the dotnet newsgroups, probably
..dotnet.framework.vbnet.

Bob Barrows
 
M

m_ evergreen

Thank you,

I've reposted my question in:
Newsgroups: microsoft.public.dotnet.vb.general
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top