FAQ WebControls
The CSK breaks up the display of content into smaller controls. For example, under Engine\Framework\ContentPages\Controls
, you’ll find a control to display the content title (in Title.cs
), and the content’s brief description (BriefDescription.cs
), which can display our FAQ question and the introduction. All we will need to add are a couple of controls specific to the FAQ module: a control to display the answer and the reference, and a control to provide a link for authorized users to edit the FAQ content.
FaqAnswer and FaqReference
All of the controls at this level derive from the .NET Framework WebControl
class. We simply need to set the CssClass
property for our control, retrieve the text to display from the current HttpContext
, and override the RenderContents
method to write the text.
Create these controls in the Engine\Module\Faqs\Controls
directory. The control to display the answer to an FAQ is as follows:
using System; using System.Web; using System.Web.UI; using System...