A ServerPage app object allows two framework-supported methods: the InitializeComponent Sub and the OnPageEvent sub meant for handling events raised from the web page.
When adding the OnPageEvent method via the drop-down selection at the top of the IDE page within a ServerPage code tab, the following method stub is added (for a ServerPage called MyServerPage):
Protected Sub MyServerPage_OnPageEvent(ByVal ctl As NextGen.Framework.WebUI.HtmlBuilder.BaseCtl, ByVal evtArgs As NextGen.Framework.WebUI.HtmlBuilderEventArgs)
End Sub
The template sub has the "Handles" assignment missing from the end of the method signature. Without this, the method will not get called when page events are raised. To fix this, just add the following to the end of the signature: Handles Me.OnPageEvent. The above example would then look like this:
Protected Sub MyServerPage_OnPageEvent(ByVal ctl As NextGen.Framework.WebUI.HtmlBuilder.BaseCtl, ByVal evtArgs As NextGen.Framework.WebUI.HtmlBuilderEventArgs) Handles Me.OnPageEvents
End Sub
No comments:
Post a Comment