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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:03:33+00:00 2026-06-13T17:03:33+00:00

Im working in MVC 3 with Razor views. I’ve created a page that calls

  • 0

I”m working in MVC 3 with Razor views. I’ve created a page that calls a partial view

@Html.Partial("_FeaturedRatesBox")

which looks like this:

@model IEnumerable<AppleWeb.Models.RateViewer>

<div class="col">
<h3>Today's Featured Rates</h3>
<form method="post" action="">
  <div class="tabber">
    <ul class="tabs unstyled">
      <li class="selected"><a href="#tab1">Loans</a></li>
      <li><a href="#tab2">Deposits</a></li>
    </ul>
    <div class="tab" id="tab1">
    @foreach (var item in Model)
    {
        <div class="rate"> <span class="left">@item.AccountName <br />
        </span> <span class="right"> As low as <span class="percent">@item.Rate</span></span></div>
        <!-- end of rate -->
    }
    </div>
    <!-- end of tab -->
    <div class="tab" id="tab2"> Loremipsum
    </div>
    <!-- end of tab -->
    <button type="submit" class="btn alignright">Apply Now</button>
  </div>
  <!-- end of tabber -->
</form>
</div>

and the rateviewer.cs model looks like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.EntityModel;
using AppleWeb.Models;

namespace AppleWeb.Models
{
    public class RateViewer
    {
        private PublicWebEntities pubDB = new PublicWebEntities();
        public virtual IEnumerable<DepositRate> FeaturedRatesDeposit()
        {
            var data = from item in pubDB.DepositRates
                       where item.Featured.Equals(true)
                       select item;
            return data.ToList();
        }
    }
}

It errors out on the line calling the partial view and says

CS1061: ‘AppleWeb.Models.RateViewer’ does not contain a definition for ‘AccountName’ and no extension method ‘AccountName’ accepting a first argument of type ‘AppleWeb.Models.RateViewer’ could be found (are you missing a using directive or an assembly

Well AccountName and Rate are both entity names for the DepositRates Entity Object. From the DataModel.Designer file:

public static DepositRate CreateDepositRate(global::System.Int32 rateID, global::System.String accountName, global::System.Double rate, global::System.Double aPY, global::System.Int16 sortingOrder)
{
    DepositRate depositRate = new DepositRate();
    depositRate.RateID = rateID;
    depositRate.AccountName = accountName;
    depositRate.Rate = rate;
    depositRate.APY = aPY;
    depositRate.SortingOrder = sortingOrder;
    return depositRate;
}

I’d hope to make this work as such, because then I can use this model elsewhere on the site.

  • 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-13T17:03:35+00:00Added an answer on June 13, 2026 at 5:03 pm

    You need to iterate the IEnumerable property on your Model ie. @foreach (var item in Model.FeaturedRatesDeposit)

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

Sidebar

Related Questions

I am working on asp.net MVC 3 application. I have created a Razor view
I've a following asp.net mvc razor view code which doesn't seem to be working:
I am working in ASP.NET MVC 3 application, I am using razor view. I
The DataAnnotations validator not working in asp.net mvc 4 razor view, when using the
have everything working fine with mvc.razor generator. Views from my library project show up
MVC 3 VB.NET razor. I have a view that has 4 dropdown boxes in
VS2010 Ultimate, ASP.NET MVC 3 w/Razor. I've created a custom view engine in my
I have been working on this MVC 3 Razor app and typically utilize view
In my ASP.net MVC App (using Razor views) I have a ProductDetails view. This
I am working on ASP.net MVC 3.0 Razor View Engine Application. I have a

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.