App_Code class call funcrion in aspx.cs file?

K

Karl Mitschke

I have a CommonFunctions.cs file in App_Code, which has several classes.

I can call the functions in these classes from my aspx pages with no problem.

Now, I'd like to streamline my code further.

Assume the following:

page1.aspx
page2.aspx
page3.aspx
page4.aspx

All pages have a code behind file.

In each cs file are three functions:

fnCreate_Object
fnDelete_Object
fnChangeAddress


In all cases, the contents of the functions differ based on the object type.

Now, in CommonFunctions, I validate various stuff, and assuming everithing
passes, I have a switch statememt to see what action is requested.

Once I know the action, how can I call the function on the referring page?

Using Page page = (Page)HttpContext.Current.Handler; I can access controls
on the page.

How can I access the functions on the page?

I suppose I could return a bool indicating the status of my validations,
and have page run the switch statement to determine the next steps, but I
have the feeling I should be able to call the functions directly?

Thanks

Karl
 
H

Harry

Hi Karl,
I have the same problem to solve as described by you here. I am coding this
in vb. Can you please send me the exact implementation that worked for you???
If needed, I can send you the exact explaination about what I need to do.

Thanks!!!

Harry.
 
H

Harry

I am sorry, I mean to say vb.net.

Harry said:
Hi Karl,
I have the same problem to solve as described by you here. I am coding this
in vb. Can you please send me the exact implementation that worked for you???
If needed, I can send you the exact explaination about what I need to do.

Thanks!!!

Harry.
 
K

Karl Mitschke

Hello Harry,

I'm the wrong one to ask about this :)

Perhaps ask in one of the VB newsgroups.
Hi Karl, I have the same problem to solve as described by you here. I
am coding this in vb. Can you please send me the exact implementation
that worked for you??? If needed, I can send you the exact
explaination about what I need to do.

Thanks!!!

Harry.

Kar
 

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,588
Members
45,092
Latest member
vinaykumarnevatia1

Latest Threads

Top