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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:01:21+00:00 2026-06-07T00:01:21+00:00

I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and

  • 0

I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and creating my first MVC4 app, my model data isn’t displaying on the web page.

Model

namespace DistributorManagement.Models
{
    public class Vaporizer
    {
        public int Id { get; set; }    
        public string Manufacturer { get; set; }
    }
}

Controller

public class VaporizerController : Controller
{
    public ActionResult Index()
    {
        Vaporizer vaporizer = new Vaporizer();
        vaporizer.Id = 1;
        vaporizer.Manufacturer = "Acme";

        return View(vaporizer);
    }
}

View

@model DistributorManagement.Models.Vaporizer

@{
    ViewBag.Title = "Vaporizer";
}

<h2>Snuh</h2>

<label>Vaporizer ID</label>
@Html.Display(Model.Id.ToString())
<br />
<label>Manufacturer</label>
@Html.Display(Model.Manufacturer)

The Web Page

enter image description here

I tried a few variations of displaying the properties of a Vaporizer, but nothing ever displays on the web page. Any idea what I’m missing?

  • 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-07T00:01:22+00:00Added an answer on June 7, 2026 at 12:01 am

    You shouldn’t use the HtmlHelper extension method “Display” to display the string.
    This method takes “An expression that identifies the object that contains the properties to display” as a string parameter, and not a string to actually display.

    cf : http://msdn.microsoft.com/en-us/library/ee310174.aspx

    In your case you should just display the string like this :

    <label>Vaporizer ID</label>
    @Model.Id
    <br />
    <label>Manufacturer</label>
    @Model.Manufacturer
    

    And should work fine !

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

Sidebar

Related Questions

So today I started learning ASP.NET. Unfortunately I haven't found any good tutorials online,
I've just started learning ASP.net and I can't seem to get the GridView to
I have just started learning asp.net mvc and one reason of the primary reasons
I am learning ASP.NET MVC. I started reading MVC in Action and Pro ASP.NET
I just started learning about ASP.NET, and I have a couple of questions. Am
I have just started to work on web applications, and learning to use ASP.Net.
I am a newbie and just started learning the asp.net mvc, as I was
I just started learning ASP.NET and HTML5, and looking for experts inputs. I'm exploring
I just started learning MVC3 today, so please forgive any stupidity (particularly a poorly
I`m just started learning C#, used to be a VB programmer. In VB.NET, it

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.