Added text-danger class to asp-validation-for tag

pull/272/head
yekalkan 7 years ago
parent 9da812d9e7
commit 6e57405a90

@ -101,14 +101,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers
});
}
}
protected virtual string GetFormInputGroupAsHtml(TagHelperContext context, TagHelperOutput output)
{
var inputTag = GetInputTag(context, out var isCheckbox);
var inputHtml = RenderTagHelperOutput(inputTag, _encoder);
var label = GetLabelAsHtml(inputTag, isCheckbox);
return GetContent(label, inputHtml, isCheckbox);
}
}
}

@ -0,0 +1,18 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{
[HtmlTargetElement(Attributes = "asp-validation-for")]
public class AbpValidationAttributeTagHelper : AbpTagHelper<AbpValidationAttributeTagHelper, AbpValidationAttributeTagHelperService>, ITransientDependency
{
public AbpValidationAttributeTagHelper(AbpValidationAttributeTagHelperService tagHelperService)
: base(tagHelperService)
{
}
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Encodings.Web;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Mvc.TagHelpers;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Localization;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{
public class AbpValidationAttributeTagHelperService : AbpTagHelperService<AbpValidationAttributeTagHelper>
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.Add("class","text-danger");
}
}
}
Loading…
Cancel
Save