Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 26th, 2003, 02:15 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default problem with ListItemCollection

Hi All,
i have declared and instance of ListItemCollection and fill it like follows:

    Function GetList() As ListItemCollection

        Dim lstcol As New ListItemCollection()

        lstcol.Add(New ListItem("1st", "2342322"))
        lstcol.Add(New ListItem("2nd", "1233434"))
        lstcol.Add(New ListItem("3rd", "5464556"))

         Return lstcol
    End Function

but when attach this collection list to dropdownlist control and getting the value for control selected item i found The value equal to the text displayed!!!

and this code used to display selected item(text,value)

txt1.Text = DropDownList1.SelectedItem.Text.ToString
txt2.Text = DropDownList1.SelectedItem.Value.ToString

Any comment

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.