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
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