示例#1
0
        protected void ShowEdit( Rock.Web.Cache.BlockInstanceLocation location, int blockInstanceId )
        {
            Rock.CMS.BlockInstance blockInstance = blockInstanceService.Get( blockInstanceId );
            hfBlockLocation.Value = location.ConvertToString();

            if ( blockInstance != null )
            {
                lAction.Text = "Edit ";
                hfBlockInstanceId.Value = blockInstance.Id.ToString();
                ddlBlockType.SelectedValue = blockInstance.Block.Id.ToString();
                tbBlockName.Text = blockInstance.Name;
            }
            else
            {
                lAction.Text = "Add ";
                hfBlockInstanceId.Value = "0";
                ddlBlockType.SelectedIndex = -1;
                tbBlockName.Text = string.Empty;
            }

            lAction.Text += hfBlockLocation.Value;

            pnlLists.Visible = false;
            pnlDetails.Visible = true;
        }