Click here to Skip to main content
15,908,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to call a function which is defined in say a.aspx and now I
wanted to call it from b.aspx
How can I do this???
Any help appreciated
many thanks....
Posted
Updated 18-Aug-11 6:51am
v4
Comments
[no name] 18-Aug-11 8:58am    
Corrected for grammer and txt speak.

A much better implementation would be to use a nTier design and seperate the common method into a business layer object that could be called from either page as necessary
 
Share this answer
 
If you want to implement global methods, you need to either:

0) Create a base Page class and inherit that base page class in all appropriate aspx pages. (preferred method)

1) Create a static class and put them there.

If you need access to data in more than one page, you should stick it in a Session variable.
 
Share this answer
 
v2
create a class X which contains the common functions u wants
like..

class X
{
//functions
}

you can create object of this class in both the pages and can call functions inside that class easily...

Hope! it will help.. :)
 
Share this answer
 
Comments
[no name] 18-Aug-11 17:25pm    
Did you even read the other answers? Repeating what others post is great way to build those rep points without actually knowing anything.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900