public static TextBoxDescriptor AsProductSelector(this TagsHelper helper) { TextBoxDescriptor descriptor = helper.AsTextBox(); descriptor.AddClass(StringKeys.SelectProductClass); descriptor.AddProperty("data-width", "100%"); descriptor.AddProperty("data-url", Urls.SelectProduct); descriptor.SetTemplate("ProductSelector"); descriptor.ReadOnly(); return(descriptor); }
public static TextBoxDescriptor AsImageCaptcha(this TagsHelper tagsHelper) { TextBoxDescriptor textBoxDescriptor = tagsHelper.AsTextBox(); textBoxDescriptor.SetDisplayName("Captcha"); textBoxDescriptor.PlaceHolder("Captcha"); textBoxDescriptor.Required(); textBoxDescriptor.SetTemplate("ImageCaptcha"); textBoxDescriptor.Validator.Add(new ImageCaptchaModelValidator(textBoxDescriptor.Name)); textBoxDescriptor.MaxLength(10); textBoxDescriptor.AddClass("image-captcha"); return(textBoxDescriptor); }