Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }