Skip to content

Instantly share code, notes, and snippets.

@brlinton
Created May 7, 2011 02:40
Show Gist options
  • Save brlinton/960144 to your computer and use it in GitHub Desktop.
Save brlinton/960144 to your computer and use it in GitHub Desktop.
Sample ViewPage Base
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web.Mvc;
namespace MyNamespace.Application
{
public abstract class ApplicationViewPage<T> : WebViewPage<T>
{
protected override void InitializePage()
{
SetViewBagDefaultProperties();
base.InitializePage();
}
private void SetViewBagDefaultProperties()
{
ViewBag.CurrentYear = DateTime.Now.Year.ToString();
// other awesome view bag initializations
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment