Example #1
0
 public static void PropagateSection(this WebViewPage page, string sectionName)
 {
     if (page.IsSectionDefined(sectionName))
     {
         page.DefineSection(sectionName, delegate() { page.Write(page.RenderSection(sectionName)); });
     }
 }
Example #2
0
 /// <summary>
 /// 隐藏指定的@section
 /// </summary>
 /// <param name="page"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 public static IHtmlString HideSection(this WebViewPage page, string name)
 {
     //@section _Xxx
     //{
     //
     //}
     page.DefineSection(name, () =>
     {
     });
     return(null);
 }
Example #3
0
 /// <summary>
 /// 用指定的部分页渲染@section
 /// </summary>
 /// <param name="page"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 public static IHtmlString RenderSectionWithPartial(this WebViewPage page, string name)
 {
     //@section _Xxx
     //{
     //    @Html.Partial("_Xxx")
     //}
     page.DefineSection(name, () =>
     {
         page.Html.RenderPartial(name);
     });
     return(null);
 }
Example #4
0
        /// <summary>
        /// 隐藏指定的@section
        /// </summary>
        /// <param name="page"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static IHtmlString HideSection(this WebViewPage page, string name)
        {
            //@section _Xxx
            //{
            //
            //}
            var fixSectionName = name.Replace("/", "");

            page.DefineSection(fixSectionName, () =>
            {
            });
            return(null);
        }