TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
531
2.4k
598.3k
error - if list is zero checking in View, MVC.
Mar 13 2017 12:48 AM
Hello everyone,
I'm working on MVC 5, there is a viewmodel class and contain a static list as the same class.
public
class
PartnerProjectVM
{
public
int
idPartnerProject {
get
;
set
; }
public
string
ProjectName {
get
;
set
; }
public
string
ProjectDescription {
get
;
set
; }
public
static
List<PartnerProjectVM> listPartnerProjectVM =
new
List<PartnerProjectVM>();
}
In view,
How can I check
@model Reboxwebapp.Models.ViewModel.PartnerProjectVM
@if (listPartnerProjectVM.Count() != null)
{
<
div
class
=
"col-sm-3"
>
<
div
>
<
a
class
=
"list-group-item active left-menu-head"
>
Projects List
</
a
>
@foreach (var item in listPartnerProjectVM)
{
<
a
href
=
"#"
id
=
"idProject"
class
=
"list-group-item"
name
=
"@item.idPartnerProject"
>
@item.ProjectName
</
a
>
}
</
div
>
</
div
>
}
Here error occurred. please help me...
Reply
Answers (
6
)
how to edit a record in grid using asp.net
Please provide any POC on asp.net MVC,WCF