Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 February 21st, 2011, 12:47 PM
Registered User
 
Join Date: Jan 2011
Posts: 9
Thanks: 6
Thanked 0 Times in 0 Posts
Default CheckBoxList

Hi
i want when no item selected after Submit show this message "Nothing Selected" what should i do ?
Thanks
Code:
  Protected Sub Btnsub_Click(ByVal sender As Object, ByVal e As 
      lblresult.Text = "You Chose:<br/>"
      Dim Lstitems As ListItem
      For Each Lstitems In CheckBoxList1.Items
      If Lstitems.Selected Then
      lblresult.Text &= "<br/>" & Lstitems.Text & "<br/>"
        End If
      Next
      End Sub
http://hotfile.com/dl/106538473/07d5...itled.png.html
 
Old March 14th, 2011, 06:09 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

put a counter in your loop. If 0 items are selected, show your message





Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckboxList onselectindexchanged rlb ASP.NET 2.0 Professional 1 August 13th, 2008 12:56 PM
Checkboxlist epkgupta Visual Studio 2005 0 March 11th, 2008 05:31 AM
CheckBoxList stu9820 ASP.NET 1.0 and 1.1 Basics 10 May 25th, 2006 08:15 PM
Checkboxlist problem sansircar ASP.NET 1.0 and 1.1 Professional 1 March 12th, 2006 01:36 AM
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.