@model HelloWorldMvcApp.SampleViewModel
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("Child1", "Value1");
dict.Add("Child2", "Value2");
dict.Add("Child3", "false");
dict.Add("Child4", "true,false");
var dic = dict.ToDictionary(w => w.Key, w => w.Value == "true,false" ? "true" : w.Value);
XElement root = new XElement("Root",
from keyValue in dict.ToDictionary(w => w.Key, w => w.Value == "true,false" ? "true" : w.Value)
select new XElement(keyValue.Key, keyValue.Value)
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
.field-validation-error {
<div class="col-md-6 col-md-offset-3">
@using (Html.BeginForm())
@Html.TextBox("StartDate", string.Empty, new { @class = "datepicker" })
<div class="alert alert-warning fade">
<img src="//dl.dropboxusercontent.com/s/lq0mgxtxtc4uj1e/morph.jpg?dl=1&token_hash=AAGm5lEcLzicmV_-T4h6Hc_3iBvhKVerZlOjvGP_vjpoJQ" /><br/><br/>
<strong><span class="alert-content"></span></strong>
<script type="text/javascript">
$( ".datepicker" ).datepicker();