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 6338259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:24:30+00:00 2026-05-24T19:24:30+00:00

I have a partial view that is not rendering: The designer is telling me

  • 0

I have a partial view that is not rendering:

The designer is telling me
the foreach(Dress d in Model) is missing a closing character “}”
the foreach(Picture p in d.Pictures) is missing a closing character “}”
and the LI item is not closed

@model IEnumerable<MyApp.Model.Dress>

        <ul class="thumbs noscript">
            @{                                                              
                foreach (Dress d in Model)
                { 
                    foreach(Picture p in d.Pictures)      
                    {                      
                        string dressPrefix = "images/Dresses/"+p.Dress.DressName;
                        string bigThumb = dressPrefix+"-"+p.Caption+"_bigthumb.jpg";
                        string thumb = dressPrefix+"-"+p.Caption+"_thumb.jpg";
                        string dressTitle = d.DressName+" "+d.Price.ToString();

                    <li>
                        <a class="thumb" href="@bigThumb" title="@dressTitle">
                            <img src="@thumb" alt=""@dressTitle" />
                        </a>
                    </li>                                                        
                    }
                }
            }
        </ul>

 public class Dress
    {
        public int ID { get; set; }
        public int GalleryTypeID { get; set; }
        public virtual GalleryType GalleryType { get; set; }
        public int DressTypeID { get; set; }
        public virtual DressType DressType { get; set; }
        public int DesignerID { get; set; }
        public virtual Designer Designer { get; set; }
        public string Description { get; set; }
        public string DressName { get; set; }
        public string Bust { get; set; }
        public int DressLength { get; set; }
        public int SleeveLength { get; set; }
        public decimal Price { get; set; }
        public int Waist { get; set; }
        public int test { get; set; }

        public virtual ICollection<DressColor> DressColors { get; set; }
        public virtual ICollection<Picture> Pictures { get; set; }

    }

public class Picture
{
    public int ID { get; set; }
    public Dress Dress { get; set; }
    public string Caption { get; set; }
    public string PictureURL { get; set; }
}

Any ideas?

  • 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-05-24T19:24:32+00:00Added an answer on May 24, 2026 at 7:24 pm

    Take out hte extra braces, also you have an extra quote in the alt attribute of the img tag, which is probably what is causing your unclosed tag problem.

    @model IEnumerable<MyApp.Model.Dress>
    
    <ul class="thumbs noscript">
    @foreach (Dress d in Model) { 
        foreach(Picture p in d.Pictures) {                      
            string dressPrefix = "images/Dresses/"+p.Dress.DressName;
            string bigThumb = dressPrefix+"-"+p.Caption+"_bigthumb.jpg";
            string thumb = dressPrefix+"-"+p.Caption+"_thumb.jpg";
            string dressTitle = d.DressName+" "+d.Price.ToString();
    
            <li>
                <a class="thumb" href="@bigThumb" title="@dressTitle">
                    <img src="@thumb" alt="@dressTitle" />
                </a>
            </li>                                                        
        }
    }
    </ul>
    

    FYI, you really shouldn’t be doing that much code in your view, that should be in your controller. You should also use string.Format to format the strings, not using the + operator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i have created a view model and have a partial form that is
I have a partial view that inherits from ViewUserControl<Guid?> - i.e. it's model is
I have partial view that displays model-specific flash messages. The partial looks like: app/views/mymodel/_flashpartial.erb
I have a partial view that I want to basically take care of itself
I have a partial view that is shared between two controllers and I'm trying
I have a partial view (UserControl) that implements a simple pager in my Asp.Net
I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured
I'm using MVC2 with VS2010 I have a view that has two partial views
in a partial view I have the following: <%Html.RenderAction(MVC.User.GetComments(Model.UserGroupName)); %> can I render a
I have a view that is not strongly typed. However I have in this

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.