Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (17 sloc) 628 Bytes
@{
var attributes = new Dictionary<string, object>();
attributes.Add("type", "datetime");
attributes.Add("class", "text-box single-line");
//since this is a constraint, IsRequired and other constraints
//won't necessarily apply in the browser, but in case script
//turns off readonly we want the constraints passed
if (ViewData.ModelMetadata.IsReadOnly)
{
attributes.Add("readonly", "readonly");
}
if (ViewData.ModelMetadata.IsRequired)
{
attributes.Add("required", "required");
}
}
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, attributes)