Fix: CheckBoxList checked attribute encoding

This commit is contained in:
Gary Sharp
2013-10-28 14:11:31 +11:00
parent 233d62442c
commit 7096a511c3
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
itemNextId++;
var itemId = forceUniqueIds.HasValue ? string.Format("{0}_{1}_{2}", id, item.Value, forceUniqueIds++) : string.Format("{0}_{1}", id, item.Value);
<li>
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? "checked=\"checked\" " : " ")/><label for="@itemId">@item.Text</label></li>
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? new HtmlString("checked=\"checked\" ") : null)/><label for="@itemId">@item.Text</label></li>
}
}
</ul>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
// Runtime Version:4.0.30319.34003
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -375,7 +375,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" ");
#line 43 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, item.Selected ? "checked=\"checked\" " : " ");
WriteTo(@__razor_helper_writer, item.Selected ? new HtmlString("checked=\"checked\" ") : null);
#line default
#line hidden