Steve
|
| Posted: 09/20/2002, 2:39 PM |
|
I have some functions that will be required in 95% of the pages I am developing. They perform additional Table/Record Authenication.
My question is: Where is the best place to put the common custom code.
In the Common.asp? Page 234 of the CCS Tutorial shows an example modifying the CCLoginUser Function. But what about future releases/patches. In the case of the example, will a patch that fixes the common.asp function CCLoginUser overwrite the modifications, or will the patch not be applied to that fuction?
It appears that some sort of time/stamp or version control is bieing carried in the common.asp file. 'CCLoginUser @0-866CACEF appears before the funcion. The @x-xxxxxxxx appears for all functions/code.
I can place my custom code at the bottom of the COMMON.ASP. Would patches that fix any of the common.asp code would still apply? If I place an Include at the bottom of common.asp, Would patches that fix any of the common.asp code would still apply?
The one thing I don't want to do is place it in every page.
|
|
|
 |
eDuck
|
| Posted: 09/21/2002, 12:20 AM |
|
In what you have described, you want to place the code in before show event. There are two sets of events, form events and field events. Depending on where the best place for your specific application, you might put it on either. I find that most of my code is on the Before Show, and if it deals with a field after the Record Show event.
I don't think there is a hard and fast rule, but you want to put your code as close as possible to the place after CCS has done what it's suppose to be doing and before outputting the code to the browser. Think through how the system compiles and renders the code, and decide where it makes more sense to display this.
|
|
|
 |
Nicole
|
| Posted: 09/24/2002, 1:19 AM |
|
Steve,
here is some explanation:
1. the parts of modified code are highlighted in white to let you identify them. They won't be overwritten while page/project regeneration. I'm not sure about future CCS versions, but this feature was added specially to let users to preserve custom code. So never mond you're using old or later CCS verisons the code will be left as it modified.
2. the generated blocks of code are surrounded with special comments like:
<block name> @x-xxxxxxxx
The value is after "@" sign is changed after page/project regeneration. These comments are used by CCS generator.
3. I suggest you to put custom functions which are extensively used in the common.asp files to be able to call them on any project page.
|
|
|
 |
|