skip to Main Content

I am working on the C# ASP.Net MVC project. I use Entity Framework for crud stuff. I am trying to show a text from my database in a div but not list type. I want to manage my index page content and title. I can do crud stuff but I don’t know how can I show data in a div can you help me?

2

Answers


  1. if I understand correctly you want to add c# code in Html tags
    don’t forget to use the @ for c#

    <div>
          <p>@user.FirstName</p>
    </div>
    Login or Signup to reply.
  2. If you mean Home Index page, you’ll need to pass in a model in order to reference the data you want passed from the Home controller Index method.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search