global fx

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
could i make a function global in global.asax and call it from other classes
in the same assembly? If so, is this a good idea? How would i reference it
because when i type in global.(..) in the editor it doesn't give me any
public stuff.

thanks,
rodchar
 
rodchar said:
hey all,
could i make a function global in global.asax and call it from other
classes
in the same assembly? If so, is this a good idea? How would i reference it
because when i type in global.(..) in the editor it doesn't give me any
public stuff.

thanks,
rodchar

The global file is just a holding area for known events.

To have a "global function" create a utility class and have your function
static (c#) or shared (vb.net)

public class GlobalFunctions

{

private GlobalFunctions()

{

}

public static int MyFunction()

{

return 1;

}



Call it using



GlobalFunctions.MyFunction();
 
Back
Top