Ich habe eine Rasierer Ansicht (Framework 4.5, MVC 5) und ein HTML-Input-Typ = Checkbox mit dem Wert gleich einem Modell booleschen Wert, sondern anstelle von True oder False bindet "Wert ".MVC 5 Razor View nicht verbindlich bool zur Eingabe
Dies ist mein Code:
for (int index = 0; index < Model.Item1.Locations.Length; index++)
{
WSTupleOfInt32StringStringBoolean location = Model.Item1.Locations[index];
<div class="editor-field">
<input id="@string.Format("presentation.ServiceInfoes[{1}].Locations[{0}].Key", index, Model.Item2)" type="checkbox" value="@location.ThirdValue" name="@string.Format("presentation.ServiceInfoes[{1}].Locations[{0}].ThirdValue", index, Model.Item2)" />
</div>
<div class="editor-label">
<label for="@string.Format("presentation.ServiceInfoes[{1}].Locations[{0}].Key", index, Model.Item2)">@location.FirstValue</label>
@if (!string.IsNullOrEmpty(location.SecondValue))
{
<a href="@string.Format("//maps.google.com/?q={0}", location.SecondValue)" target="_blank"><img alt="@location.SecondValue" src="@string.Format("//maps.google.com/maps/api/staticmap?center={0}&markers=color:blue|{0}&zoom=15&size=64x64&sensor=false", location.SecondValue)" /></a>
}
</div><br />
}
Die location.ThirdValue
ist die Boolesche Eigenschaft, debuging die Eigenschaft es ist in Ordnung .. aber in der HTML erhalte ich value="value"
und nicht value="false"
.
Was passiert?