In this article, Kirill Chilingarashvili demonstrates how to use a T4 template to generate a navigation class in ASP.NET. This class contains nested classes that represent folders and string constants that represent user control (.ascx) files in the application. Using such navigation class helps to avoid hard-coding file paths as string literals and since it is automatically generated there is no need to maintain string constants manually.
T4 (Text Template Transformation Toolkit) is a template-based code generation engine. It is available in Visual Studio 2008 and as a download in DSL and GAT toolkits for Visual Studio 2005. T4 engine allows you to use ASP.NET-like template syntax to generate C#, T-SQL, XML or any other text files.
For more information about T4, check out my previous article.