I want to modify helpers such as this one:
<%= Html.CheckBoxFor(m => m.Current, new { @class = "economicTextBox", propertyName = "Current", onchange = "UseCurrent();UpdateField(this);" })%>
to also take as a parameter another string that signifies a permission in the app, and then INSIDE the method I would determine whether or not to return the actual HTML or nothing, depending on their permission.
How would I do this?
UPDATE 2: Checkbox not rendering as readonly
When I debug and check the value of htmlHelper.CheckBoxFor(expression, mergedHtmlAttributes)._value, I get this
<input checked="checked" class="economicTextBox" id="Current" name="Current" onchange="UseCurrent();UpdateField(this);" propertyName="Current" readonly="true" type="checkbox" value="true" /><input name="Current" type="hidden" value="false" />
but the checkbox is still rendering allowing me to change it and achieve full functionality. Why?