コード例 #1
0
        public static PartialViewsDependancies GetFromRequest()
        {
            PartialViewsDependancies partialViewsDependancies = HttpContext.Current.Items["PartialViewsDependancies"] as PartialViewsDependancies;

            if (partialViewsDependancies == null)
            {
                partialViewsDependancies = new PartialViewsDependancies();

                SetToRequest(partialViewsDependancies);
            }

            return(partialViewsDependancies);
        }
コード例 #2
0
        public static string RenderStyles()
        {
            PartialViewsDependancies partialViewsDependancies = GetFromRequest();

            return(partialViewsDependancies.Styles.Aggregate("", (current, script) => current + (script + " \r\n")));
        }
コード例 #3
0
 public static void SetToRequest(PartialViewsDependancies partialViewsDependancies)
 {
     HttpContext.Current.Items["PartialViewsDependancies"] = partialViewsDependancies;
 }