The advantage of razor syntax over asp.net syntax just using on short tag “@” instead of “<%= %>”??
Is it any other feature or data binding method razor can do, but asp.net syntax not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Razor is pretty cool, it can often detect if you are writing HTML code in your code blocks. So say that you are declaring a big block of C# code, by using @. You then write a foreach-loop in that, and write some HTML that should be echoed out. In ASP.net markup, you’d have to end the C# code block with %> and then reopen it with <%. Razor, on the other hand, can detect when you are writing HTML and does that for you. It will also detect where you put the bracket that closes the loop, without you having to put it within <% %>. Very handy, and a timesaver.
For more information: Click click.