I am newbie in VB.net. First of all, sorry for my length post bcos I have to describe my probelm in detail. I have created a very simple UserControl with 1 property and 1 event (by creating Class Library Project in VB.Net). In another new winodws application project, I add this UserControl to the project by Project -> Add Reference, it can be ran without any problem, that is property can be get/set and the event can be captured.
But when I embedded this UserControl (let's say ClassLib.dll) in html, although I also can set/get it's property , I don't know how to captured the event in web page rasied by this UserControl.
the code that I embeded this UserControl are as follow: <OBJECT id="myControl1" name="myControl1" classid="ClassLib3.dll#ClassLib3.UserControl1"> <PARAM NAME="TriggerTime" value="8/7/2006"> </OBJECT>
This problem is surrounding me for a week, I have no luck after search internet and cause me a big headache. Would any one please give me advice that would be a great appreciate.
P.S. My UserControl code are as follow:
Public Interface IClassLib3 Property TriggerTime() As String Sub OnTrigger(ByVal e As EventArgs) Event Trigger As EventHandler End Interface
Public Class UserControl1 Implements IClassLib3
Private _TriggerTime As String Public Event Trigger As EventHandler Implements IClassLib3.Trigger
Public Property TriggerTime() As String Implements IClassLib3.TriggerTime Get Return _TriggerTime End Get Set(ByVal value As String) _TriggerTime = value lblTrigger.Text = _TriggerTime End Set End Property
Protected Overridable Sub OnTrigger(ByVal e As EventArgs) Implements IClassLib3.OnTrigger RaiseEvent Trigger(Me, e) End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick lblClock.Text = Now.ToString
If Trim(lblClock.Text) = Trim(_TriggerTime) Then Label3.Text += "*" OnTrigger(New EventArgs()) End If End Sub
End Class
|
No responses found. Be the first to respond and make money from revenue sharing program.
|