A quick time saver tip today… On my projects I like to create base classes from which items such as ASPX templates and ASCX user controls can inherit. Base classes are Class Files that are placed into the App_Code folder. This allows me to place commonly used code into one place that is then made available to all the templates and/or controls in the project.
For example, I have a C# class called “BasePage” which has a public property of “ContentId”. This property holds the Ektron Content ID for the current paqe. The Init event of the BasePage class will look for “id” or “ekfrm” or “pageid” on the querystring and use the value to populate the ContentId property. This means that every ASPX template or ASCX control has a property called “ContentId” from which you can quickly get the content id.
Prior to this I found I was always writing code to get the content Id from the querystring (typically an Ektron template takes in a single content Id).
With these classes in place you will soon, over time, continue to add to them and ultimately this will save a little bit of time here and there.
You must be logged in to post a comment.