SomeObject record = new SomeObject();
record.value1 = 1;
record.value2 = "hello";
<td><input type="checkbox" id="indicator_@record.value1_@record.value2" /><td>
What is the proper razor syntax to create a checkbox with an id of "indicator_1_hello"?
When attempting this way, it says the object doesn't contain a definition for value1_ (understandable) and when I tried "indicator_@record.value1@_@record.value2" if had a runtime error about something named _ not existing in the context (again, understandable).
edit:
As a temporary solution I've done:
SomeObject record = new SomeObject();
record.value1 = 1;
record.value2 = "hello";
var combined = String.Format("{0}_{1}", record.value1, record.value2);
<td><input type="checkbox" id="indicator_@combined" /><td>
I am still curious if you can do it all inline though.