Creating my own functions in global.asax.cs

D

David

Hi,

I have seen in some site implementations code has been entered into
global.asax.cs in its own function, not any of the regular application or
session functions that exist in here.

What I want to be able to do is to have workflow in my project. The workflow
may be extended by future programmers by adding code into the global.asax.cs
file. The code should be optional, i.e. if the function does not exist (even
by name) then my code will not crash.

How can I extend my workflow process in this way?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
D

David

I guess this is not quite as easy as it sounds.

I would search google but not knowing how to phrase the query, I am a little
stumped. If anyone has any idea or can point me in a direction to do this,
it owuld be much appreciated.

Basically, I just need to increase the functionality of global.asax.cs.

Thanks.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
M

Mark Rae

I guess this is not quite as easy as it sounds.

I would search google but not knowing how to phrase the query, I am a
little stumped. If anyone has any idea or can point me in a direction to
do this, it owuld be much appreciated.

Basically, I just need to increase the functionality of global.asax.cs.

I guess the main question is why does it have to be global.asax...?

If you need some extra functionality, just create a new class...

In the future, 100 programmers could add 100 new classes, if that's how you
want to structure your app...

As for your app not crashing if it can't find a particular class or method,
that's what try...catch is for...
 
D

David

I can't see how I can do "plug-in classes" like this.

My pages have a work flow. I want to be able to allow anyone to be able to
plug in extra code into the workflow, without the workflow needing to know
what the class is. I have seen it done with global.asax.cs before.

I guess I could write it another way...

Have a "workflow" project with empty classes. Each class being responsible
for a specific area of the workflow. My project then calls each class during
each workflow process. If nothing is written, then nothing need be done,
though it will allow an external developer to easily add into the workflow.

Right then, if I go that route, then I need to be standard in the
arguments... the way I have seen it done before in global.asax.cs is like...

public void workflow_stage(object sender, eventargs e)
{
}

How can I use the sender and eventargs to be as generic as I can?

(After I wrote the original, I then realised try..catch..)

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top