[IronPython] [Language Question] Building a function pointer/delegate like
Mohamed A. Meligy
eng.meligy at gmail.com
Tue Jun 19 23:55:23 PDT 2007
Hey all,
I'm trying to build a filter web user control using IP 2.0 (included in
ASP.NET 2.0 Futures May 2007 CTP). In it, I need other pages/controls using
this filtering control to be able to assign a property in the filter control
to a method in that pages/control using the filter, so, inside the filter
control itself, on certain action, I can call the page/control method from
inside the filter control.
I've tried something like:
_FilterFunction = None
def GetFilterFunction():
return _FilterFunction
def SetFilterFunction(value):
_FilterFunction = value
def Filter_Change(sender, e):
global _FilterFunction # I added that line later as a try to fix
_FilterFunction()
Inside my page, I've tried something like:
def Page_Load(sender, e):
ucFilter.SetFilterFunction(FilterFunc)
pass
def FilterFunc()
#Actual use of the filter values comes here
pass
What I get then is a runtime exception saying that _FilterFunction is not
callable.
Is there any other certain way to do that ??
--
Regards,
Mohamed Ahmed Meligy
Senior Software Engineer
Silver Key (www.SilverKeyTech.com) - Egypt Branch
E-mail: Eng.Meligy (AT) Gmail.com (NO SPAM PLEASE)
Weblog: http://GeeksWithBlogs.NET/Mohamed
Mobile: +20 10 603 3013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070620/ff7f7d0d/attachment.html
More information about the users
mailing list