protected override void OnInit( EventArgs e ) { Rock.Web.UI.DialogMasterPage masterPage = this.Page.Master as Rock.Web.UI.DialogMasterPage; if ( masterPage != null ) masterPage.OnSave += new EventHandler<EventArgs>( masterPage_OnSave ); try { int blockInstanceId = Convert.ToInt32( PageParameter( "BlockInstance" ) ); _blockInstance = Rock.Web.Cache.BlockInstance.Read( blockInstanceId ); if ( _blockInstance.Authorized( "Configure", CurrentUser ) ) { var attributeControls = Rock.Attribute.Helper.GetEditControls( _blockInstance, !Page.IsPostBack ); foreach ( HtmlGenericControl fs in attributeControls ) phAttributes.Controls.Add( fs ); } else { DisplayError( "You are not authorized to edit this block" ); } } catch ( SystemException ex ) { DisplayError( ex.Message ); } base.OnInit( e ); }
protected override void OnInit(EventArgs e) { Rock.Web.UI.DialogMasterPage masterPage = this.Page.Master as Rock.Web.UI.DialogMasterPage; if (masterPage != null) { masterPage.OnSave += new EventHandler <EventArgs>(masterPage_OnSave); } try { int blockInstanceId = Convert.ToInt32(PageParameter("BlockInstance")); _blockInstance = Rock.Web.Cache.BlockInstance.Read(blockInstanceId); if (_blockInstance.Authorized("Configure", CurrentUser)) { var attributeControls = Rock.Attribute.Helper.GetEditControls(_blockInstance, !Page.IsPostBack); foreach (HtmlGenericControl fs in attributeControls) { phAttributes.Controls.Add(fs); } } else { DisplayError("You are not authorized to edit this block"); } } catch (SystemException ex) { DisplayError(ex.Message); } base.OnInit(e); }
protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack && _blockInstance.Authorized("Configure", CurrentUser)) { tbBlockName.Text = _blockInstance.Name; tbCacheDuration.Text = _blockInstance.OutputCacheDuration.ToString(); } base.OnLoad(e); }