PageRenderTime 96ms CodeModel.GetById 84ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/pigeoncms/Modules/PigeonCms.Placeholder/views/Placeholder.ascx.cs

http://pigeoncms.googlecode.com/
C# | 51 lines | 45 code | 6 blank | 0 comment | 2 complexity | 152e8cd94b3ef1702146c62eebe206cf MD5 | raw file
 1using System;
 2using System.Data;
 3using System.Configuration;
 4using System.Collections;
 5using System.Web;
 6using System.Web.Security;
 7using System.Web.UI;
 8using System.Web.UI.WebControls;
 9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11using System.Web.Caching;
12using PigeonCms;
13using PigeonCms.Core.Helpers;
14
15public partial class Controls_Placeholder : PigeonCms.BaseModuleControl
16{
17
18    private string name = "";
19    public string Name
20    {
21        get { return GetStringParam("Name", name); }
22        set { name = value; }
23    }
24
25    public string PageContent
26    {
27        get { return LitContent.Text; }
28    }
29
30
31    protected void Page_Load(object sender, EventArgs e)
32    {
33        var obj1 = new PigeonCms.Placeholder();
34        var cache = new CacheManager<PigeonCms.Placeholder>("PigeonCms.Placeholder");
35        if (cache.IsEmpty(this.Name))
36        {
37            obj1 = new PlaceholdersManager().GetByName(this.Name);
38            cache.Insert(this.Name, obj1);
39        }
40        else
41        {
42            obj1 = cache.GetValue(this.Name);
43        }
44
45        LitContent.Text = "";
46        if (obj1.Visible)
47        {
48            LitContent.Text = obj1.Content;
49        }
50    }
51}