ASP.NET MVC 3: Automatically generating view while adding controller (without Entity Framework)

I am trying to learn MVC. I want to automatically generate the required view code as and when I add a controller. This is possible if I select the option “Controller with read/write actions and views, using Entity Framework” . However I am not using Entity Framework. How can I achieve the similar behavior without using Entity Framework? And why it is unable to automatically generate the view when I don’t use Entity Framework?

Checking login user role in razor page

@if (Request.IsAuthenticated && User.Identity.Name=="administrator") { <div id="sidebar"> <div class="module"> <ul class="menu"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> </div> <div class="mainContent"> Hello, @User.Identity.Name ! </div> </div> This is my layout if the user is authenticated as administrator but this sort of check looks no good, I need to check the role of … Read more