aspx_beginners thread: Raise custom event from web user control....
Hi there,
I would like to raise a custom event that I have defined from my web use
control. This event is raised when a button is clicked on my web user
control and a dataset is passed as an argument (parameter). In my
webform I want to handle this event, and use the passed dataset.
So far I have=85.
In my web user control code=85.
Public Event SearchButton_OnClick(ByVal ReturnedDataset As DataSet)
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSearch.Click
=91Code to create and populate a dataset called dsDataSet
'Raise the event and pass the dataset as a parameter
RaiseEvent SearchButton_OnClick(dsDataSet)
End Sub
...now in my webform (container of my user control), I don=92t know how
to
access and handle this event I have created...so far I have something
like this in my webform....
'This line declares my user control (by the way, why do we not actually
instantiate a user control with the 'New' keyword, it is only declared
using Dim??? Ie. Where is the instance of the class actually
instantiated?)
Protected ucFindComputers As CCMComputerFind
...now, to actually reference my event I have....
Sub SearchButton_OnClick(ByVal ReturnedDataSet As DataSet)
End Sub
This was all done of the top of my head and ofcourse does not work,
please correct me and inform me of the correct way to go about this.
Should there not be a 'Handles myControl.MyEvent' statement (or similar)
alongside the line ' Sub SearchButton_OnClick(ByVal ReturnedDataSet As
DataSet)'??
Please help..
Thanks
Dale
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003