locked
Razor syntax not working RRS feed

  • Question

  • User-1477986377 posted
    I have installed vs 2008 on 2010. I have installed webmetrix on 2011. Today I started to use razor syntax in webmetrix in the above version,in cshtml file but when I run it, displays oh uh something went wrong. Error code 500.
    But when I remove razor syntax in cshtml file it runs normally.

    Whats the problem.


    Thursday, April 14, 2016 5:32 PM

Answers

  • User753101303 posted

    Hi,

    Error 500 is a server side exception. If you don't see the exact message, you should find a message in the Windows event log. Once you have this message it should be much easier to understand what happens and to fix this problem (I'm not using WebMatrix).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 14, 2016 5:44 PM
  • User-166373564 posted

    Hi,

    Firstly it's recommended to debug Razor sites, there are two steps:

    • Display information that helps analyze and debug pages.
    • Use debugging tools in Visual Studio.

    This is a demo: Debugging ASP.NET Web Pages (Razor) Sites

    Secondly, you need check write  razor syntax correctly, these are some tips: http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-c 

    Have a good day.

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 8:30 AM

All replies

  • User753101303 posted

    Hi,

    Error 500 is a server side exception. If you don't see the exact message, you should find a message in the Windows event log. Once you have this message it should be much easier to understand what happens and to fix this problem (I'm not using WebMatrix).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 14, 2016 5:44 PM
  • User-166373564 posted

    Hi,

    Firstly it's recommended to debug Razor sites, there are two steps:

    • Display information that helps analyze and debug pages.
    • Use debugging tools in Visual Studio.

    This is a demo: Debugging ASP.NET Web Pages (Razor) Sites

    Secondly, you need check write  razor syntax correctly, these are some tips: http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-c 

    Have a good day.

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 8:30 AM