protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BlockController bc = new BlockController();
         var blocks = bc.GetBlocks(PortalId);
         if (blocks != null)
         {
             ddlBlock.DataSource = blocks.Select(b => b.Name).Distinct();
             ddlBlock.DataBind();
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    hlAdd.NavigateUrl = EditUrl("Edit");
                    var tc = new BlockController();

                    gvBlocks.DataSource = tc.GetBlocks(PortalId);
                    gvBlocks.DataBind();
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }