Click here to Skip to main content
Click here to Skip to main content

asp.net mvc razor loops syntax

, 23 Aug 2011
Rate this:
Please Sign up or sign in to vote.
asp.net mvc razor loops syntax
ref : asp.net mvc razor loops
 
Let’s look at following example where we want to list some Employees information using Razor view engine
 
<ul>
  @foreach(var emp in EmployeeList)
  {
	<li>
		@emp.EmployeeName - (@emp.EmpCode)
	</li>  
  }
</ul>

License

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

About the Author

A Mahesh
Web Developer
India India
Symphony Services, Banglore, 560 087, India
Follow on   Twitter

Comments and Discussions

 
Questionthe title is good Pinmemberhouzhimin27-Aug-13 16:37 
GeneralMy vote of 1 PinmemberMember-394866318-Oct-12 19:20 
Question[My vote of 2] not an article PinmemberDonsw2-Apr-12 16:24 
GeneralWhy create a tip/trick for basic syntax? PinprotectorAspDotNetDev24-Aug-11 7:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 24 Aug 2011
Article Copyright 2011 by A Mahesh
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid