Hello:
I have a WebContainer called “ProductPurchases” that I embed with a WebPage using the EmbedWithin method. So far, so good.
Here’s where I’m stuck:
I created an Event Definition within the WebContainer called: GenerateReport. (it takes no arguments) and I use RaiseEvent GenerateReport (within a button pressed event). The button is also a part of the WebContainer.
I created a Method in my webpage called: GenerateReportHandler (with no arguments).
Here’s my code for embedding the webcontainer and “attempting” to add the event handler:
var mPurchases As New ProductPurchases(purchaseList)
AddHandler mPurchases.GenerateReport, AddressOf GenerateReportHandler
mPurchases.SetBorderAttributes()
mPurchases.EmbedWithin(self, 0, 160, mPurchases.Width, mPurchases.Height)
mPurchases.Left = (self.Width - mPurchases.Width) / 2
When I attempt to compile, I get the following errors:
DeskRegSigninPage.EmbedPurchasesContainer, line 3
Type mismatch error. Expected delegate Delegate( ProductPurchases.ProductPurchases ), but got delegate Delegate( )
AddHandler mPurchases.GenerateReport, AddressOf GenerateReportHandler
AND this error:
DeskRegSigninPage.EmbedPurchasesContainer, line 3
This method requires fewer parameters than were passed
AddHandler mPurchases.GenerateReport, AddressOf GenerateReportHandler
I’m completely at a loss at this point. Any thoughts?