Results 1 to 2 of 2

Thread: Has an item from the listbox been selected?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    32

    Has an item from the listbox been selected?

    Does anyone know how to check if a selection has been made from a list Box?

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    I have a listbox named group:

    Group.Items(Group.SelectedIndex).Value


    As for handling the event, you need to have an event handler similar to:
    Public Sub GroupSelected(ByVal sender As Object, ByVal e As EventArgs) Handles Group.SelectedIndexChanged

    and the tag looks like:

    <asp:DropDownList id="Group" runat="server" OnSelectedIndexChanged="GroupSelected" AutoPostBack="True"></asp:DropDownList>
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width