Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:29:24+00:00 2026-06-01T08:29:24+00:00

In the ASP.NET MVC Razor engine I want to show three data entries in

  • 0

In the ASP.NET MVC Razor engine I want to show three data entries in each row so I write this:

<table width="100%" border="0" cellspacing="22" cellpadding="0" style="line-height:18px;">
    <tr>
        <td align="center" valign="top">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    @{
                        int counter = 0;
                        foreach (MVCTaranehMah.Models.Folder item in ViewBag.items)
                        {
                            counter++;
                            if(counter%3 == 0)
                            {
                                <tr>
                            }
                            <td width="205" height="180" align="center" valign="top"><a href="galleryDetails?id=@item.id" ><img src="@Url.Content(item.thumb)" width="173" height="173" border="0"></a><br />
                                <p align="center" valign="top" class="header3">@item.title</p>
                            </td>
                            @if(counter%3 == 0)
                            {
                                </tr>
                            }
                        }
                    }
                 </tr>
            </table>
        </td>
    </tr>
</table>

But I get this error

The code block is missing a closing “}” character. Make sure you have a matching “}” character for all the “{” characters within this block, and that none of the “}” characters are being interpreted as markup.

What’s the problem and how can I do something like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:29:26+00:00Added an answer on June 1, 2026 at 8:29 am

    I think the code does not like that you seemingly have unclosed HTML tags.

    Place before the tr, @:

    Remove @ from the front of the other if statement.

    For example:

    if (counter%3 == 0)
    {
        @:<tr>  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to download and install razor view engine for ASP.Net MVC 2. From
I am using Razor view engine in ASP.Net MVC 3 RC 2. This is
I want to use reCaptcha control in my asp.net mvc 3 razor view engine
I have asp.net mvc application, that uses razor view engine. I want to send
Using a Telerik Grid with ASP.NET MVC 3 Razor engine. When a user selects
I'm using Extensions for ASP.NET MVC Q3 2011(open source version) with Razor engine and
I am using ASP.NET MVC 3 with the Razor view engine . I have
I've been fiddling with asp.net mvc 3 with the new razor view engine. My
Using ASP.NET MVC can be used the view engine Razor. Razor let you use
The Razor view engine in ASP.NET MVC supports @helper to define little helper methods.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.