phil
Posts: 4
|
| Posted: 11/06/2008, 10:27 PM |
|
Apologies in advance if this is a naff question, I am not much of a coder.
I was looking at the many to many listbox example and I am modifiying the custom Subroutine written for it for my own purposes.
The example recommends inserting the custom Sub somewhere between action events. However isn't that a bit sloppy? Doesn't that mean if I regenerate the project from the basic CCS files I will lose that custom code?
I find that using one of the after/before events causes issues as you find yourself nesting your sub in another sub or inside an if...then statement so it won't compile.
So where is the best location for custom code that keeps it inside the CCS framework.
Regards
Phil
|
 |
 |
melvyn
Posts: 333
|
| Posted: 11/07/2008, 7:01 AM |
|
Hi phil,
No, no, no...
let's do a check in your project, let's say you have a page example.ccp which generates asp or php or java, whatever, let's say php. CCS will generate a file named example.php and example_events.php which contains your custom code. Never edit by yourself the main example.php because that's the generated and *_events.php is the yours.
all custom code must be inserted after you go to properties, events and add a code block, that generates a function and your code must be *inside* that function.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
phil
Posts: 4
|
| Posted: 11/09/2008, 3:26 PM |
|
Hi Melvyn,
Thanks for the response. I understand that your meant to keep your custom code inside the event system. However the Codecharge example in 'many to many listbox' suggests arbitrarily copying the example subroutine directly between event blocks.
I don't wish to do that. However using the event system I end up having troubles as the events themselves are often between if..end if blocks or inside other subroutines.
In a non code-charge web project I would normally just stick it in an include file (asp) or a class file with shared functions/subroutines(asp.net).
So my question is where do people put there common shared functions and contstants in a .net codecharge project??
|
 |
 |
|