Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 January 17th, 2004, 09:25 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listbox Indexes

I am using a listbox control to display a list of names from a database. They are being loaded using a dataReader, and the names display properly. But for some reason, when the names are clicked and selected, the selectedIndexChanged event does not fire, and the selected index value remains -1. Has anyone seen this before, and have an idea of how to fix.

I appreciate the help.
 
Old January 18th, 2004, 12:15 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is your databind call to this list conditional based on IsPostback? If you bind the list every time you load the page, you'll essentially reset the list control. This results in no Changed event.

If Not IsPostback Then
    'Do databind
End If



Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 18th, 2004, 12:29 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

to enable fire for the event selectedIndexChanged you have to modify the property for listbox.autoPostback to true

Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Indexes luisjeronimo BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 June 27th, 2008 09:34 AM
Indexes for searching fizzerchris SQL Language 0 May 22nd, 2007 07:09 PM
Indexes for searching fizzerchris SQL Server 2005 0 May 22nd, 2007 07:08 PM
Composite indexes Fysicus SQL Language 1 June 28th, 2006 11:05 PM
Indexes SQ SQL Language 1 October 5th, 2004 10:24 PM





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