It drives me in a circle. I have been a VB.NET form developer for a long time, completely new to ASP.NET and completely new to MVC . I am creating vbhtml pages that use VB.NET Razor syntax, and I seem to be constantly struggling with a UI that is trying to defer my code incorrectly. Take the following template-based example for the new Razor view:
@Code Layout = Nothing End Code <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div> @If True Then @<ul> @For x = 1 To 2 Next </ul> End If '<-- Randomly indented too far </div> </body> </html>
In the above example, as soon as I press return after Next , End If , the two lines below randomly jump the two tabs forward, where they should be from. In other examples, I ended up in a circle where clicking one line at the right place throws another line out of position and vice versa.
I am so annoyed at this moment, I would be happy to completely turn off auto-scooping and handle it myself, but I canβt even figure out how to do it! Following the tips in another thread, I turned off the indentation for the HTML pages, but all that stops is the indentation of the HTML tags - the blocks of code are still sliding all over the place.
I thought the extension might cause the problem, but I disabled them all and restarted, and the problem remained. Am I doing something fundamentally wrong? I find it hard to believe that Microsoft will release something so poor that it seems more likely, I just do not use it correctly.
source share