Groups | Blog | Home
all groups > inetserver asp general > november 2003 >

inetserver asp general : DropDownList Looses Items when Browser Page is Refreshed


m_evergreen NO[at]SPAM yahoo.com
11/26/2003 3:22:38 PM
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"))
Bob Barrows
11/26/2003 6:39:37 PM
[quoted text, click to view]

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"

m_ evergreen
11/28/2003 8:30:38 AM
Thank you,

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


*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button