Skip to content

Instantly share code, notes, and snippets.

@PraveenMathew92
Created May 24, 2024 19:09
Show Gist options
  • Save PraveenMathew92/181d4104d2cb230f9c5d6d00efeb5cf4 to your computer and use it in GitHub Desktop.
Save PraveenMathew92/181d4104d2cb230f9c5d6d00efeb5cf4 to your computer and use it in GitHub Desktop.
// <copyright>
// Copyright by the Spark Development Network
//
// Licensed under the Rock Community License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.rockrms.com/license
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
//
using System;
using System.ComponentModel;
using Rock;
using Rock.Model;
using Rock.Web.Cache;
namespace RockWeb.Blocks.Core
{
/// <summary>
/// Block for administrating a tag
/// </summary>
[DisplayName( "Cache Test" )]
[Category( "Core" )]
[Rock.SystemGuid.BlockTypeGuid( "1DD0157B-E5C3-4B1B-9EE0-22C9F531D924" )]
public partial class CategoryCacheTest : Rock.Web.UI.RockBlock
{
/// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.Load" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
protected override void OnLoad( EventArgs e )
{
base.OnLoad( e );
var definedValueId = PageParameter( "DefinedValueId" ).ToIntSafe();
var definedValue = DefinedValueCache.Get( definedValueId );
lbDefinedValue.Text = definedValue?.Value ?? "";
lbCache.Text = definedValue?.CategoryName ?? "";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment