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 20th, 2003, 11:13 AM
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 listbox event SelectedIndexChanged

i have filled a listbox and i put some code to be executed when selection change using event SelectedIndexChanged, but nothing happen
i know that changing the property AutoPostBack to true could solve the problem put if not what is the benefit of the event

is it to use client scripting (while temperory disable for Server side scripting)


Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old December 21st, 2003, 11:45 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Using AutoPostBack won't solve the problem of an event not firing if something is wrong. It simply means that changing the value of a listbox will cause a postback. Any other client-side event that causes a postback will post the page and the listbox's SelectedIndexChanged event will fire (along with any other event(s) on the page that are triggered by user inputs.

Are you confusing server side event's with client-side events? With ASPX any "event" you write a handler for is a server-side event. Web forms work on the postback model. If you want to do things client-side only, you'll have to work around the postback model and write javascript to handle the control's client-side events.

What is not happening that you are expecting to have happen when you change the listbox selection?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 22nd, 2003, 10:50 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

thx Peter, i have got it:)
i only was to change a sample of (listbox,button)to only (listbox)


Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
help related to a SelectedIndexChanged event suneet.pant ASP.NET 2.0 Professional 1 May 22nd, 2008 04:41 PM
ListBox.SelectedIndexChanged not fired (composite) studen77 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 March 27th, 2007 08:40 PM
SelectedIndexChanged Event doesn't fire ddudley3 ASP.NET 2.0 Professional 7 February 6th, 2006 10:47 AM
adding SelectedIndexChanged event to listbox msrnivas General .NET 1 July 19th, 2005 02:47 PM
Listbox selectedindexchanged event venterjo General .NET 6 December 9th, 2004 08:46 AM





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