I know I can conditionally add an id value via
<select id="@(aBool ? @someId: "")"
I don’t want id="". This won’t pass W3C validation and appears to make jQuery slam its face into the ground. Can I go a step further and conditionally add id?
Something like this (doesn’t work):
<select @(aBool ? id=\"@someId\": "")
It’s just text, so using
@(cond? "id='meep'" : "")should do it.As a side note, I finally figured out how you embed expressions in Razor!