Click here to Skip to main content
14,663,485 members
Rate this:
Please Sign up or sign in to vote.
See more:
public class clsListingDetails
{
        private string _SystemName;
        public string SystemName
        {
            get { return _SystemName; }
            set { _SystemName = value; }
        }

        private string _MaxCharacters;
        public string MaxCharacters
        {
            get { return _MaxCharacters; }
            set { _MaxCharacters = value; }
        }
}

public class User
{
public Dictionary<string, ArrayList> colListingDetails { get; set; }
}

In above colListingScreenReportPrintDetails we storing clsListingDetails properties. But it is set according to user type. For some user it is not set but I can I check whether or not is set..??
Posted
Updated 10-Sep-15 1:18am
v2
Comments
F-ES Sitecore 10-Sep-15 7:00am
   
Check if it's null?
Matt T Heffron 10-Sep-15 13:28pm
   
Side notes:
1. ArrayList is pretty much obsolete and has been replaced with the type-safe List<T> (which in your case would be List<clsListingDetails>)
2. Why is MaxCharacters a string? Its name implies that it is an integer. Use numbers AS numbers and only convert to/from string representations for user interaction, and, IF NECESSARY, persistence.
Kailas_ 11-Sep-15 1:34am
   
Thanks Matt T Heffron for suggestion..!

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Check for the null value like below

if ( clsListingDetails.MaxCharacters == null )
{

}
   
Comments
Kailas_ 10-Sep-15 7:38am
   
Not exact But I get Idea, I can't do that directly instead I have check like
User.colListingDetails != null and its works as I stores "clsListingDetails" list in Dictionary, anyway thanks..
Abhishek Kumar Goswami 10-Sep-15 7:51am
   
Cool

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100