Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (BlockObject != null)
     {
         if (BlockObject is ItemDetailInfo)
         {
             lblContent.Text = (BlockObject as ItemDetailInfo).SummaryHtml;
         }
         else if (BlockObject is ItemHtmlInfo)
         {
             lblContent.Text = (BlockObject as ItemHtmlInfo).SummaryHtml;
         }
         else
         {
             throw new ArgumentOutOfRangeException("类型\"" + BlockObject.GetType().FullName + "\"的内容不能在HTML模块中展示。");
         }
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (BlockObject != null)
     {
         if (BlockObject is ItemCollectionInfo)
         {
             ItemCollectionFacade facade = new ItemCollectionFacade();
             int totalCount;
             int pageIndex = 0;
             IList <ItemDetailInfo> itemList = facade.GetChildrenItemList(BlockObject.Id, pageIndex, DisplayCount, out totalCount, OrderBy, Direction);
             rptList.DataSource = itemList;
             rptList.DataBind();
         }
         else
         {
             throw new ArgumentOutOfRangeException("类型\"" + BlockObject.GetType().FullName + "\"的内容不能在列表模块中展示。");
         }
     }
 }