﻿@model JoinRpg.DataModel.MarkdownString
@{
  var requiredMsg = new MvcHtmlString("");
    var validation = false;
  foreach (var attr in @Html.GetUnobtrusiveValidationAttributes(@ViewData.TemplateInfo.HtmlFieldPrefix, @ViewData.ModelMetadata))
  {
      if (attr.Key == "data-val-required")
      {
          requiredMsg = new MvcHtmlString("data-val-required='" + HttpUtility.HtmlAttributeEncode((string) attr.Value) + "'");
          validation = true;
      }
  }
}
<div>
    Можно использовать <a href="http://daringfireball.net/projects/markdown/syntax">MarkDown</a> (**<b>полужирный</b>**, _<i>курсив</i>_) <br/>
    <textarea
        class="form-control"
        cols="100"
        id="@(ViewData.TemplateInfo.HtmlFieldPrefix)_Contents"
        name="@(ViewData.TemplateInfo.HtmlFieldPrefix).Contents"
        @requiredMsg @(validation ? "data-val=true" : "") 
        rows="4">@(Model == null ? "" : Model.Contents)</textarea>
</div>
@if (validation)
{
@Html.ValidationMessageFor(model => Model.Contents, "", new { @class = "text-danger" })
}
﻿@model JoinRpg.DataModel.MarkdownString
@{
  var requiredMsg = new MvcHtmlString("");
    var validation = false;
  foreach (var attr in @Html.GetUnobtrusiveValidationAttributes(@ViewData.TemplateInfo.HtmlFieldPrefix, @ViewData.ModelMetadata))
  {
      if (attr.Key == "data-val-required")
      {
          requiredMsg = new MvcHtmlString("data-val-required='" + HttpUtility.HtmlAttributeEncode((string) attr.Value) + "'");
          validation = true;
      }
  }
}
<div>
    Можно использовать <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">MarkDown</a> (**<b>полужирный</b>**, _<i>курсив</i>_) <br/>
    <textarea
        class="form-control"
        cols="100"
        id="@(ViewData.TemplateInfo.HtmlFieldPrefix)_Contents"
        name="@(ViewData.TemplateInfo.HtmlFieldPrefix).Contents"
        @requiredMsg @(validation ? "data-val=true" : "") 
        rows="4">@(Model == null ? "" : Model.Contents)</textarea>
</div>
@if (validation)
{
@Html.ValidationMessageFor(model => Model.Contents, "", new { @class = "text-danger" })
}
Make Markdown help open in another window
Make Markdown help open in another window
