[Ironpython-users] Event handler for dynamic added Controls
Bernd Viehmann
bernd.viehmann at googlemail.com
Fri Mar 29 12:21:56 CET 2013
Upps, please forget the question.
It has nothing to do with iron-python.
in asp.net you always have to bind dynamic event-handlers in Page_Init or
Page_Load handlers. Must be done that way always
Kind regards Bernd
2013/3/29 Bernd Viehmann <bernd.viehmann at googlemail.com>
> Hello,
>
> I am working on a ASP.NET web-application written in IronPython. I have
> to create some widgets dynamically in the code-behind file.
>
> Unfortunately the Click-Handler is not called when i click a
> dynamic-created LinkButton.
>
> Here is the code:
>
> ------------------------------------------...
> # add a linkbutton to the webform
> lnkBtn = LinkButton()
> lnkBtn.Text = itm[0]
> lnkBtn.ID = 'hyLnk_tagg_' + System.Convert.ToString( iCnt )
> lnkBtn.EnableViewState = False
> lnkBtn.CssClass =
> lnkBtn.Click += HandleTaggLink
> ...
>
> def HandleTaggLink( sender, e ):
> try:
> urlNext = None
>
> tool.log.w2lgDvlp( 'HandleTaggLink called in topic_display_taggs '
> + sender.ID )
>
> except Exception,e:
> tool.log.w2lgError(traceback.format_exc())
>
> if urlNext != None:
> Response.Redirect( Page.ResolveUrl( urlNext ) )
>
>
>
> ------------------------------------------
> Some idea what went wrong?
>
> Regards
>
> Bernd
>
--
Mit freundlichen Grüßen
Bernd Viehmann
Mahrweg 46
41836 Hückelhoven
Tel.: 02433 9640 100
Fax: 02433 9640 109
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130329/c6505995/attachment.html>
More information about the Ironpython-users
mailing list