Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
error - if list is zero checking in View, MVC.
Mani Kandan
Mar 13 2017 12:48 AM
278
Reply
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...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
how to edit a record in grid using asp.net
Please provide any POC on asp.net MVC,WCF