Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Unassigned: ASPPARSE error when @ character follows tag name [152]

$
0
0
The latest version of RazorGenerator (1.6.3) produces ASPPARSE error when '@' character is used immediatelly after a tag name, for example in ASP.NET MVC [_WebGridRenderer.cshtml](http://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Helpers/WebGrid/_WebGridRenderer.cshtml):

```
<thead>
<tr@CssClass(headerStyle)>
```

_... error ASPPARSE: Encountered end tag "thead" with no matching start tag. Are your start/end tags properly balanced?_

The error does not appear when RazorGenerator is not enabled.




Comments: Here's a repro that's similar to this line of code from WebGridRenderer.cshtml: ``` <thead> <tr@CssClass(headerStyle)> ``` ``` @functions { private string GetClass(string c) { return c; } } @helper GetStuff() { <div@GetClass(c)>Hello world</div@GetClass(c)> } ``` Razor v1 produces: ``` public static System.Web.WebPages.HelperResult GetStuff() { return new System.Web.WebPages.HelperResult(__razor_helper_writer => { WriteLiteralTo(@__razor_helper_writer, " <div"); WriteTo(@__razor_helper_writer, CssClass(c)); WriteLiteralTo(@__razor_helper_writer, ">Hello world</div"); WriteTo(@__razor_helper_writer, GetClass(c)); WriteLiteralTo(@__razor_helper_writer, ">\r\n"); }); } ``` whereas v2\v3 produces: ``` public static System.Web.WebPages.HelperResult GetStuff() { return new System.Web.WebPages.HelperResult(__razor_helper_writer => { WriteLiteralTo(__razor_helper_writer, " <div@GetClass(c)>Hello world</div@GetClass(c)>\r\n"); }); } ``` Is this the same code you're seeing generated on your box? Also, I can't seem to repro the error you're seeing. Have you modified the contents of the file in any way?

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>