public override void Process(TagHelperContext context, TagHelperOutput output) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (output == null) { throw new ArgumentNullException(nameof(output)); } if (this.Name != null) { if (this.Name.Metadata == null) { throw new ArgumentException(nameof(Name)); } string value = NameAndIdProvider.GetFullHtmlFieldName(ViewContext, this.Name.Name); output.Attributes.SetAttribute("name", value); } }
public override void Process(TagHelperContext context, TagHelperOutput output) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (output == null) { throw new ArgumentNullException(nameof(output)); } if (this.Id != null) { if (this.Id.Metadata == null) { throw new ArgumentException(nameof(Id)); } string idFieldName = NameAndIdProvider.GetFullHtmlFieldName(ViewContext, this.Id.Name); string idFieldValue = NameAndIdProvider.CreateSanitizedId(this.ViewContext, idFieldName, _generator.IdAttributeDotReplacement); output.Attributes.SetAttribute("id", idFieldValue); } }