As a developer I would like to point out some kind of error/missing feature when using the razor engine. It took me quite some time to locate the exact position of the ommitted bracket and I would like to point this out to other developers so they can either
pay close attention to it or even find/create some fix.
In the visual studio environment, no notification is given when one forgets to place a curly bracket at the end of html attributes included within a certain htmlhelper.
In the example above, it isn't that cumbersome to find the ommitted bracket at the end of the html attributes. But when you should forget that simple curl before closing the parameterlist, the application will compile/build/... and it can run. Only when
the page is shown, the error is thrown that you have typed a curly bracket where there shouldn't be one. The error will occur at the following line (which isn't the actual errorline, but is at the end of the generated html-page generator class, that is in
it's turn generated by ASP.Net):
WriteLiteral("</div>\r\n");
}
}
}
Since none of us actually wrote the generator for this html code, it can be quite cumbersome as to find the actual error, especially when you are using nested views. The search for the opening curly bracket is a real pain and a simple build-error would fix
the problem in an instant.
So I would like to ask/suggest to include this in the parser included with mvc4.
Thanks in advance,
If you have any remarks or similar experiences, do let me know. Such simple problems shouldn't take so long to be found.
RoyVc
0 Points
1 Post
No closing bracket notification
Jan 02, 2012 12:26 PM|LINK
Hi,
As a developer I would like to point out some kind of error/missing feature when using the razor engine. It took me quite some time to locate the exact position of the ommitted bracket and I would like to point this out to other developers so they can either pay close attention to it or even find/create some fix.
In the visual studio environment, no notification is given when one forgets to place a curly bracket at the end of html attributes included within a certain htmlhelper.
for example:
In the example above, it isn't that cumbersome to find the ommitted bracket at the end of the html attributes. But when you should forget that simple curl before closing the parameterlist, the application will compile/build/... and it can run. Only when the page is shown, the error is thrown that you have typed a curly bracket where there shouldn't be one. The error will occur at the following line (which isn't the actual errorline, but is at the end of the generated html-page generator class, that is in it's turn generated by ASP.Net):
WriteLiteral("</div>\r\n");
}
}
}
Since none of us actually wrote the generator for this html code, it can be quite cumbersome as to find the actual error, especially when you are using nested views. The search for the opening curly bracket is a real pain and a simple build-error would fix the problem in an instant.
So I would like to ask/suggest to include this in the parser included with mvc4.
Thanks in advance,
If you have any remarks or similar experiences, do let me know. Such simple problems shouldn't take so long to be found.
zaco09
Member
240 Points
78 Posts
Re: No closing bracket notification
Jan 05, 2012 08:02 PM|LINK
you can report a bug in here:
https://connect.microsoft.com/VisualStudio/