-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anchor tag helper is broken within foreach loop #11327
Comments
I suspect it's the collection expression. Sadly Razor can not be assumed to support all C# language features from the get go. There is work being done in this area, though. Does removing |
@davidwengier: Thanks for responding. No, that makes no difference. In fact, I didn't have that part when the issue initially occurred. In fact, I tried a simple
And the tag helpers are still not recognized. I even tried declaring |
@davidwengier I was finally able to find an error in my markup. It was the following block of markup, which was above the code we discussed. Note the two double quotes at the end of the
Okay, would be nice if the editor could flag this somehow, but it's due to my error. Apologies, and thanks for looking. |
Good work! Agree, a diagnostic here would be good. Will leave this issue open for the compiler team to review. |
I have a
foreach
loop that was working, but now it isn't. Neither thea
orimg
tag helpers are working (neither in Intellisense or when I render the actual HTML). You can see in the image below that attributes likeasp-page
andasp-route-it
do not show tag helper highlighting.If I remove the
@
from myforeach
, so that it is not a C# loop, then the tag helpers look as they should look.I've spent considerable time looking for some sort of syntax error or something that might be causing this to happen, but I've found nothing.
Can anyone else suggest what to look for?
Below is what the generated HTML looks like. Note the
~
in the image path and the unmodifiedasp-page
andasp-route-id
attributes.The text was updated successfully, but these errors were encountered: