Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 June 19th, 2008, 12:00 PM
rlb rlb is offline
Authorized User
Join Date: Jan 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default CheckboxList onselectindexchanged

Hey guys,
I keep running into situtations where I have long checkboxlist or radiobutton lists - maybe 20-100 items or so but when a certain one of them is checked/unchecked (suppose it's always item #100) a method needs to be called.

Is there a better way to do this besides

<asp:checkboxlist id="uxList" onselectindexchanged="method" ...

protected void method(...){
 if( uxList.Items[100].Checked == true){ /* do somethign */}
 //else exit method

As it is above, a postback is made for every single item the user checks and it slows down their input process. I don't really want to extract the item into it's own control.

Can I make it so that when that item in the list and only that item is checked/selected/unchecked/unselected method() fires?
Old August 13th, 2008, 12:56 PM
rlb rlb is offline
Authorized User
Join Date: Jan 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts

OK, from my experience you have two options.

1. Take out the options that need to have codebehind and assign them to normal checkboxes so when the user clicks a normal box they do not have to wait for the postback.

2. The best option is to encapsulate in AJAX updatepanel.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxlist epkgupta Visual Studio 2005 0 March 11th, 2008 05:31 AM
Radiolist onselectindexchanged not firing rlb ASP.NET 2.0 Professional 1 May 23rd, 2007 01:46 PM
Get Values from Checkboxlist derekl ASP.NET 1.0 and 1.1 Basics 3 May 26th, 2006 09:46 AM
CheckBoxList stu9820 ASP.NET 1.0 and 1.1 Basics 10 May 25th, 2006 08:15 PM
CheckBoxList eddiema VS.NET 2002/2003 1 April 9th, 2004 09:49 AM

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