C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to count listbox item count in javascript


Posted Date: 07 Oct 2008      Total Responses: 2

Posted By: Patel Chirag K       Member Level: Silver     Points: 1


i have to check one validation on button click.
i want to remove item from listbox on button click event but when there is no item in listbox and i am trying to click on button then it's gives error like:
Object reference not set to an instance of an object.
so please help me for the same
can i use validation control or summry for the same.
thanks in advance
-chirag patel




Responses

Author: sappi    07 Oct 2008Member Level: GoldRating:     Points: 3
var PracticeAreaListBoxObjLength = ((document.getElementById('<%=PracticeAreaListBox.ClientID%>') != null)?document.getElementById('<%=PracticeAreaListBox.ClientID%>').length:0);

it returns 0 when there is no items



Author: Patel Chirag K    07 Oct 2008Member Level: SilverRating:     Points: 1
thanks sappi...it's useful for me


Post Reply
You must Sign In to post a response.
Next : How to download AJAX Tool
Previous : IO Permission Security Exception
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use