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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:54:24+00:00 2026-06-12T18:54:24+00:00

Now I bet this is a problem that happens often, I just can’t seem

  • 0

Now I bet this is a problem that happens often, I just can’t seem to find anything related to it, or notice myself what is wrong with it. The view provided at bottom always returns null on foreach line.

I’m making a simple currency list.

Model:

public class Currency
{
    public int ID { get; set; }
    public string Name { get; set; }
    public string Sign { get; set; }
    public float BuyValue { get; set; }
    public float MidValue { get; set; }
    public float SellValue { get; set; }

    public string CurrencyIcon { get; set; }

    [DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
    public DateTime DateCreated { get; set; }
}

And it should be posted as partial view, on several different ways so to say. For example, partial view that will get all of them (for today), and partial view that will get random 6 (also for today).

I’m doing the first part now, all of them, for today.

Controller

public ActionResult FrontPagePartial()
{
    DateTime today = DateTime.Now.Date; //i'm filtering it by date only
    var currencies = db.Currencies.Where(c => c.DateCreated.Equals(today));

    return View(currencies);
}

I’ve checked the filtering it’s working correctly. So my view goes like this:

@model IEnumerable<CurrencyList.Models.Currency>

<div id="currencyList_Partial">
    <div id="bg_currencyList_Partial">
        <img src="@Url.Content("~/Content/Resources/img.png")" />
    </div>
    <div id="header_currencyList_Partial">
        <div style="padding: 10px;">
            <p style="font-size: 18px;">
                Currency List<br />
                <span class="header_currencyList_Partial_Day">FOR TODAY</span>
            </p>
            <p class="header_currencyList_Partial_Link" >
                <a href="#">DETAILS ></a>
            </p>
        </div>
        <div id="table_currencyList">
            @foreach (var item in Model)
            { 
                <table>
                    <tr>
                        <td style="text-align: center;"><img src='@item.CurrencyIcon' title='@item.Sign' /><p style="font-size: small;">@Html.DisplayFor(modelItem => item.Name)</p><p>@Html.DisplayFor(modelItem => item.Sign)</p></td>
                        <td style="text-align: center;">@Html.DisplayFor(modelItem => item.BuyValue)</td>
                        <td style="text-align: center;">@Html.DisplayFor(modelItem => item.MidValue)</td>
                        <td style="text-align: center;">@Html.DisplayFor(modelItem => item.SellValue)</td>
                    </tr>
                </table>
            }
        </div>
    </div>
</div>

Parent view

@{
    ViewBag.Title = "Currency List Home Page";
}

@section HeadSection{
    <link rel="stylesheet" href="@Url.Content("~/Content/layerslider.css")" type="text/css" media="screen" />
    <link rel="stylesheet" href="@Url.Content("~/Content/defaultskin/skin.css")" type="text/css" media="screen" />
    <noscript>
        <link rel="stylesheet" href="@Url.Content("~/Content/noscript.css")" type="text/css" media="screen" />
    </noscript>
}

@section ScriptSection{
    <script src="@Url.Content("~/Scripts/jqueryui.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/plugins.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/page.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/layerslider.kreaturamedia.jquery.js")" type="text/javascript"></script>
}
<div id="content">
    <div id="statusbar"></div>
    <div id="slider">
        <div id="layerslider">
            <div class="ls-layer" style="slidedelay: 3000">
                <img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide1_layer1.png")" alt="layer" />
                <img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0; top: 247px;/*easingin: easeOutElastic*/" />
                <img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px;left: 15px; easingin: easeOutElastic " />
            </div>
            <div class="ls-layer" style="slidedelay: 3000">
                <img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide2_layer1.png")" alt="layer" />
                <img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0; top: 247px;/*easingin: easeOutElastic*/" />
                <img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px;left: 15px;easingin: easeOutElastic " />
            </div>
            <div class="ls-layer" style="slidedelay: 3000">
                <img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide3_layer1.png")" alt="layer" />
                <img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0;top: 247px;" />
                <img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px; left: 15px; easingin: easeOutElastic " />
            </div>
        </div>
    </div>
    <div id="converter">
        <h2>CONVERTER</h2>
        <p class="shadowedText">
            VALUE:
        </p>
        <p>
            <input type="text" id="tb11" class="tb11" />
        </p>
        <p class="shadowedText">
            FROM CURRENCY
        </p>
        <div class="select1 select1p">
                <select id="select1">
                    <option>EUR - EURO</option>
                    <option> $  - DOLLAR</option>
                </select>
            <span class="selectArrow"><img src="@Url.Content("~/Content/images/select_arrows.png")" /></span>
        </div>
        <p class="shadowedText">
            TO CURRENCY
        </p>
        <div class="select1 select1p">
                <select id="select2">
                    <option> $ - EURO</option>
                    <option> EURO  - DOLLAR</option>
                </select>
            <span class="selectArrows"><img src="@Url.Content("~/Content/images/select_arrows.png")" /></span>
        </div>
        <div class="select1p addMargin">
            <span class="boldResult">100 EUR = 11710.55 $</span><br />
            <span class="lightResult">100 $ = 0.84882 EUR</span>
        </div>
    </div>

</div>

<div id="lowerContent">
    <div id="blog"><img src="@Url.Content("~/Content/images/vesti.png")" /></div>


    //This is where Partial View is rendered
    <div id="listC">@Html.Partial("FrontPagePartial")</div>


</div>

<div id="portals">

</div>
  • 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-12T18:54:25+00:00Added an answer on June 12, 2026 at 6:54 pm

    <div id="listC">@Html.Partial("FrontPagePartial")</div>

    This is trying to render the partial view, FrontPagePartial, with the model of the parent view, which is not defined.

    public ActionResult FrontPagePartial()

    This creates an action so you can go, siteurl/controller/FrontPagePartial


    What you need to do is

    <div id="listC">@Html.Partial("FrontPagePartial", currencies)</div>

    If you don’t mind ViewBag, you can set ViewBag.Currencies in the Action method and

    <div id="listC">@Html.Partial("FrontPagePartial", ViewBag.Currencies)</div>

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

Sidebar

Related Questions

Now I try to developing an application related to Image processing, for that I
I have this table, I bet that looking at the tables, you will know
Now I'm not sure if this is something I'm doing wrong, or something thats
now i'm working on a project for creating audio unit instrument that provide the
So i bet i got you curious with that title. =) Here's the scenario
Background; to create a dropdown menu for a fun gambling game (Students can 'bet'
In PostgreSQL, there is this very useful string_agg function, that allows query like: SELECT
I would bet this is a very basic question, but i don't get it!
I have a betting application, where users can bet on sports matches (e.g. basketball).
I just did a fresh install of SugarCRM this is my 2nd time ever

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.