Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I have created a strongly typed view on a Model Person(Code given below).
Everything is working fine except i am unable to write a lambda expression for static member of class.

Please help me if i can create a view on static member.
i want to access the value of count but using lambda expression only.
C#
public class Person
    {
        public string FristName { get; set; }
        public string LastName { get; set; }
        public DateTime BithDate { get; set; }
        public string FavoriteColor { get; set; }
        public static int Count { get; set; }
    }


HTML
<%: Html.LabelFor(model => model.Count) %>
Posted
Comments
Sergey Alexandrovich Kryukov 23-Nov-11 11:39am    
Not clear. Please use "Improve question" above. What did you try?
--SA
binkujsr 24-Nov-11 0:45am    
My doubt is, how can i write lambda expression for Count(Static Member of Person class)?

<%: Html.LabelFor(model => model.Count) %>
Why above code is not working?if there is any way to write expression to access the static member of class?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900