Using MVC to Develop the Project (Cont.)


View (Index.cshtml)
Two user interfaces, Index.cshtml and Privacy.cshtml, are used in this project:


C:\ASP.NET-workspace\HelloWorld\Views\Home\Index.cshtml
 @{
   ViewData["Title"] = "Home Page";
 }

 <div class="text-center">
  <h1 class="display-4">Welcome</h1>
  <p>Learn about <a href="https://learn.microsoft.com/aspnet/core">
    building Web apps with ASP.NET Core</a>.</p>
 </div>

where @{ ViewData[...] refers to accessing data stored within the ViewData dictionary within a code block in a Razor view (.cshtml): In summary: @{ ViewData[...] is used within Razor views to access data passed from the controller via the ViewData dictionary, allowing you to use that data within the view’s C# code block for further processing or rendering.




      “Asian women, we live forever.    
      And you know why we’re such bad drivers?    
      Because we’re trying to die.    
      We’re like, 'Yeah! Let me see how invincible I really am!”    
      — Ali Wong