Skip to content

Instantly share code, notes, and snippets.

@demofan
Created December 5, 2017 05:47
Show Gist options
  • Save demofan/54e86ef8a78a6d764bcb4b900a71f00a to your computer and use it in GitHub Desktop.
Save demofan/54e86ef8a78a6d764bcb4b900a71f00a to your computer and use it in GitHub Desktop.
陽春型 CheckBox EditorTemplates
@{
bool isChecked = false;
if (string.IsNullOrWhiteSpace(ViewData.TemplateInfo.FormattedModelValue.ToString())==false)
{
isChecked = !string.IsNullOrWhiteSpace(ViewData.TemplateInfo.FormattedModelValue.ToString()) && Convert.ToBoolean(ViewData.TemplateInfo.FormattedModelValue);
}
var dic = new Dictionary<string, string> { };
var attributes = ViewData.MergeAttributes(dic);
}
@Html.CheckBox("", isChecked, attributes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment