Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 16, 2011 07:26 PM by Sl0vi
Contributor
2777 Points
1161 Posts
Aug 16, 2011 06:45 PM|LINK
What is wrong with this short segment of code from my MVC 3 project?
<table> @for( int i = 0; i < Model.Count; ++i ) { <dt> <dr> Model[i].ProductTitle </dr> <dr> Model[i].ProductDescription </dr> <dr> Model[i].ProductLink </dr> <dt> } </table>
I keep getting a runtime error talking about a missing '}' that I know is there and don't think is being interpeted as content.
Participant
1478 Points
248 Posts
Aug 16, 2011 06:50 PM|LINK
Maybe try to put that first { on the next line...shouldn't matter but not sure..it looks right
@for( int i = 0; i < Model.Count; ++i ) {
Aug 16, 2011 06:53 PM|LINK
wait...isn't it supposed to be <tr> and <td>? You table looks wrong...?
Member
108 Points
21 Posts
Aug 16, 2011 07:26 PM|LINK
Is this a table? then it should be <tr> and <td>. If not, then what is a dr tag?
Also you haven't closed your <dt> tag. The last <dt> tag should be </dt>. Not closing html tags properly often confuses the razor viewengine.
eric2820
Contributor
2777 Points
1161 Posts
Missing '}'
Aug 16, 2011 06:45 PM|LINK
What is wrong with this short segment of code from my MVC 3 project?
<table> @for( int i = 0; i < Model.Count; ++i ) { <dt> <dr> Model[i].ProductTitle </dr> <dr> Model[i].ProductDescription </dr> <dr> Model[i].ProductLink </dr> <dt> } </table>I keep getting a runtime error talking about a missing '}' that I know is there and don't think is being interpeted as content.
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.
Bryan Strade...
Participant
1478 Points
248 Posts
Re: Missing '}'
Aug 16, 2011 06:50 PM|LINK
Maybe try to put that first { on the next line...shouldn't matter but not sure..it looks right
Bryan Strade...
Participant
1478 Points
248 Posts
Re: Missing '}'
Aug 16, 2011 06:53 PM|LINK
wait...isn't it supposed to be <tr> and <td>? You table looks wrong...?
Sl0vi
Member
108 Points
21 Posts
Re: Missing '}'
Aug 16, 2011 07:26 PM|LINK
Is this a table? then it should be <tr> and <td>. If not, then what is a dr tag?
Also you haven't closed your <dt> tag. The last <dt> tag should be </dt>. Not closing html tags properly often confuses the razor viewengine.