Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have this situation. I wrote some code and it works just fine when I run it locally on my Visual Studio server, but when I send it to my web site, it doesn't work.

 

The code looks like this:

    Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ListBox1.SelectedIndexChanged
       ListBox2.Items.Clear()
       If ListBox1.SelectedItem.Text = "ab" Then
           ListBox2.Items.Add("aaaabbb")
           ListBox2.Items.Add("aaacccc")
           ListBox2.Items.Add("aaadddd")
       End If
End Sub

 

It's pretty simple. it populates a second listbox with some values when I click on an item in listbox1.

AutoPostBack is set to True on my listboxes and I have enabled ViewStates for my listboxes.

ListBox1 comes with predefined items, but when I click on of that items nothing happens if I run it on my website.

What could be the problem?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...