示例#1
0
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(long?model)
        {
            string val = model != null?model.ToString() : "";

            HtmlAttributes.Add("class", "yt_text20");
            HtmlAttributes.Add("maxlength", "30");
            return(await TextEditComponent.RenderTextAsync(this, val, "yt_longvalue"));
        }
示例#2
0
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(string model)
        {
            HtmlAttributes.Add("class", "yt_text40");
            StringLengthAttribute lenAttr = PropData.TryGetAttribute <StringLengthAttribute>();

            if (lenAttr == null)
            {
                HtmlAttributes.Add("maxlength", Globals.MaxEmail.ToString());
            }
            return(await TextEditComponent.RenderTextAsync(this, model?.ToString() ?? "", "yt_email"));
        }
示例#3
0
 /// <summary>
 /// Called by the framework when the component needs to be rendered as HTML.
 /// </summary>
 /// <param name="model">The model being rendered by the component.</param>
 /// <returns>The component rendered as HTML.</returns>
 public async Task <string> RenderAsync(string model)
 {
     HtmlAttributes.Add("class", "yt_urlremotepage");
     HtmlAttributes.Add("maxlength", Globals.MaxUrl);
     return(await TextEditComponent.RenderTextAsync(this, model != null?model : "", "yt_urlremotepage"));
 }
示例#4
0
 /// <summary>
 /// Called by the framework when the component needs to be rendered as HTML.
 /// </summary>
 /// <param name="model">The model being rendered by the component.</param>
 /// <returns>The component rendered as HTML.</returns>
 public async Task <string> RenderAsync(Guid?model)
 {
     HtmlAttributes.Add("class", "yt_text40");
     HtmlAttributes.Add("maxlength", "40");
     return(await TextEditComponent.RenderTextAsync(this, model != null?model.ToString() : "", "yt_guid"));
 }
示例#5
0
 /// <summary>
 /// Called by the framework when the component needs to be rendered as HTML.
 /// </summary>
 /// <param name="model">The model being rendered by the component.</param>
 /// <returns>The component rendered as HTML.</returns>
 public async Task <string> RenderAsync(string model)
 {
     HtmlAttributes.Add("type", "password");
     HtmlAttributes.Add("autocomplete", "new-password");
     return(await TextEditComponent.RenderTextAsync(this, model, "yt_password20"));
 }