WebListBox Selected Item Error

1 reply. Last post: July 15, 2013 6:26 AM by Hans Kristian
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

I have a weblistbox connected to a sqldatasource; it loads perfectly.  When the page loads it sets the selected.index =0

 Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If (Not IsPostBack) Then
            Me.WebListBox1.SelectedIndex = 0
            Session.Item("ProjectID") = 25
           
        End If
    End Sub


The selected Index changed code is

Protected Sub WebListBox1_SelectedItemChanged(sender As Object, e As ISNet.WebUI.WebEssentials.WebListBoxSelectedItemChangedEventArgs) Handles WebListBox1.SelectedItemChanged
        Dim index As Integer = e.SelectedIndex
        Dim item As WebListBoxItem = TryCast(WebListBox1.Items(index), WebListBoxItem)
        Session.Item("ProjectID") = Integer.Parse(item.Value)
        'Session.Item("ProviderName") = item.Text
        Me.ASPxImageSlider1.DataBind()
        'Me.Image2.ImageUrl = item.Image
        'GetData2(Integer.Parse(item.Value))
        
    End Sub


All times are GMT -5. The time now is 3:28 AM.
Previous Next