0
@if (Request.IsAuthenticated && User.IsInRole("Administrators")
{
     <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>
}

In this code, when I type in @User. then I don't see any list of methods or properties avaliable in User class for me to autocomplete the call. Could someone guide me steps to fix this issue ?

Asp Asp
  • 864
  • 1
  • 7
  • 15
  • try referring to this problem in here http://stackoverflow.com/questions/10992983/intellisense-and-code-suggestion-not-working-in-vs2012-ultimate-rc – Chief Feb 19 '13 at 23:32
  • @Chief Thank you, but in my case it doesn't work with Razor, code suggestion works with everything except Razor – Asp Asp Feb 20 '13 at 00:17

1 Answers1

1

Looks like you're missing a ) after @if (Request.IsAuthenticated && User.IsInRole("Administrators")

Jasen
  • 14,030
  • 3
  • 51
  • 68
  • If you didn't have intellisense trouble with User@if test then you shouldn't have trouble elsewhere. Then I'd guess you have a syntax error after the test on the page. – Jasen Feb 19 '13 at 23:30
  • I have intellisense problem in all of cs razor files not just this piece of code, there is no autocomplete popup of methos and properties for me – Asp Asp Feb 19 '13 at 23:33