/// <summary> /// Creates an instance of <see cref="ScriptTemplate"/> /// </summary> /// <param name="validator">The validator to which the validator belongs.</param> /// <param name="name">Fully-qualified name of the javascript template (including the namespace)</param> /// <remarks> /// /// </remarks> public ScriptTemplate(BaseValidator validator, string name) : this(validator.GetType().Assembly, name) { Replace("@@CLIENTID@@", validator.ClientID); Replace("@@INPUT_NAME@@", validator.InputName); Replace("@@INPUT_CLIENTID@@", validator.InputControl.ClientID); Replace("@@INPUT_NORMAL_BKCOLOR@@", ColorTranslator.ToHtml(validator.InputNormalColor)); Replace("@@INPUT_INVALID_BKCOLOR@@", ColorTranslator.ToHtml(validator.InvalidInputColor)); Replace("@@INPUT_NORMAL_BORDERCOLOR@@", ColorTranslator.ToHtml(validator.InputNormalBorderColor)); Replace("@@INPUT_INVALID_BORDERCOLOR@@", ColorTranslator.ToHtml(validator.InvalidInputBorderColor)); Replace("@@INPUT_NORMAL_CSS@@", validator.InputNormalCSS); Replace("@@INPUT_INVALID_CSS@@", validator.InvalidInputCSS); Replace("@@INVALID_INPUT_INDICATOR_CLIENTID@@", validator.InvalidInputIndicator == null ? null : validator.InvalidInputIndicator.Container.ClientID); Replace("@@INVALID_INPUT_INDICATOR_TOOLTIP_CLIENTID@@", validator.InvalidInputIndicator == null ? null : validator.InvalidInputIndicator.TooltipLabel.ClientID); Replace("@@INVALID_INPUT_INDICATOR_TOOLTIP_CONTAINER_CLIENTID@@", validator.InvalidInputIndicator == null ? null : validator.InvalidInputIndicator.TooltipLabelContainer.ClientID); Replace("@@ERROR_MESSAGE@@", validator.Text); Replace("@@IGNORE_EMPTY_VALUE@@", validator.IgnoreEmptyValue? "true":"false"); }