CHAN Reference
Chan Home | Reference Home | Event Firing Order | web.config
web.config
A Chan site should have a number of items set in the web.config file. They are all psudeo-namespaced with Chan_ and each usually corresponds to a similarly named property in the static Site class, so look there for clues.
The most important three settings are the three "Root" paths, these are automatically inserted into an Control's Href/Link/Image/Path/Zoom paths where appropriate and where one of "[Chan_Root]","[Site_Root]" or "[Http_Root]" are set, either from code or from the ASPX. The Template class also has regions corresponding to these built-in.
An example web.config for a Chan driven site might look as follows:
<appSettings> <!-- Site wide titles,keywords etc, these can be left blank --> <add key="Chan_Site_Title" value="J.D.B." /> <add key="Chan_Site_Keywords" value="Jon Doe, Blog, Carrots, Handbags, Cheese" /> <add key="Chan_Site_Description" value="Jon Doe's Blog, about all his favourite things!" /> <!-- Absolute route to site root --> <add key="Chan_Http_Root" value="http://example.com/blog" /> <!-- Virtual route to site root --> <add key="Chan_Site_Root" value="/blog/" /> <!-- Virtual path to Chan resource folder --> <add key="Chan_Chan_Root" value="/Chan" /> <!-- Scratch area for file upload controls --> <add key="Chan_Temp_Dir" value="c:\temp\chan" /> <!-- How Page-specific title/keywords act against the Site-wide ones --> <!-- Valid values are "Before" , "After" and "Instead" --> <add key="Chan_Page_Title_Position" value="Before" /> <!-- Default behaviour: Does ANY button postback cause form validation? --> <!-- Valid values are "True" , "False" and "Unset" --> <add key="Chan_Form_AutoValidate" value="Unset" /> <!-- Default behaviour: Enable client-side prevalidation? --> <!-- Valid values are "True" , "False" and "Unset" --> <add key="Chan_Form_ClientValidate" value="True" /> <!-- Wether or not Controls may, must or must-not generate client side script --> <!-- Valid values are "True" , "False" and "Unset" --> <add key="Chan_Site_NoScript" value="Unset" /> </appSettings> <!-- Chan Controls Namespace --> <system.web> <pages> <controls> <add assembly="Chan" namespace="Chan.Controls" tagPrefix="chan"/> </controls> </pages> </system.web>