470,594 Members | 1,412 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

DropDownList Looses Items when Browser Page is Refreshed

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").Valu e = 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
Jul 19 '05 #1
2 1358
m_evergreen wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Thank you,

I've reposted my question in:
Newsgroups: microsoft.public.dotnet.vb.general
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jonathan | last post: by
3 posts views Thread by Richard | last post: by
8 posts views Thread by gv | last post: by
reply views Thread by fwirtanen | last post: by
11 posts views Thread by Santosh | last post: by
3 posts views Thread by =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.