“The name 'HTML' does not exist in the current context” in MVC 3 Views

后端 未结 21 2333
野的像风
野的像风 2020-12-15 03:50

I´m starting to use \"MVC 3\" but I´m facing some little problems. In my Views, when I code something like this:

@if(Request.IsAuthenticated) {
    

        
21条回答
  •  攒了一身酷
    2020-12-15 04:17

    You could try some following point:

    • Close the View with the false errors.
    • Close visual studio.
    • open project again.
    • clean your solution
    • Rebuild your solution.

    hopefully you will not get any of the similar errors now.

    If you still have same problem. than Please check following steps.

    • Make sure you have web.config file inside view folder. Becuase MVC has two web.config. one for solution and other one for project.

    Your web.config file will seems like this which is inside views folder.

    
    
    
      
        
          

    It worked for me. and hope for you also.

提交回复
热议问题