Ejemplo n.º 1
0
 internal static string ResourceString(HttpContextBase httpContext, string classKey, string resourceKey)
 {
     try
     {
         return(ResourceExtensions.GetResourceString(httpContext, classKey, resourceKey));
     }
     catch (Exception ex)
     {
         TagBuilder tagBuilder = new TagBuilder("span");
         tagBuilder.AddCssClass("help-inline translation-missing alert alert-warning");
         tagBuilder.InnerHtml = ex.Message;
         return(tagBuilder.ToString());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Renders the resource.
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="classKey">The class key.</param>
        /// <param name="resourceKey">The resource key.</param>
        public static void RenderResource(this HtmlHelper helper, string classKey, string resourceKey)
        {
            string value = ResourceExtensions.ResourceString(helper.ViewContext.HttpContext, classKey, resourceKey);

            helper.ViewContext.Writer.WriteLine(value);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Resources the specified helper.
 /// </summary>
 /// <param name="helper">The helper.</param>
 /// <param name="classKey">The class key.</param>
 /// <param name="resourceKey">The resource key.</param>
 /// <returns></returns>
 public static MvcHtmlString Resource(this HtmlHelper helper, string classKey, params string[] resourceKey)
 {
     return(ResourceExtensions.ResourceString(helper.ViewContext.HttpContext, classKey, string.Join("_", resourceKey)).ToMvcHtmlString());
 }