C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » HTML »

How to capture the event rasied by winform UserControl in html page ?


Posted Date: 10 Jul 2006      Posted By: Terry Lam      Member Level: Bronze     Points: 2   Responses: 0



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







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.
Previous : What are HTML controls and Server controls
Return to Discussion Forum
Post New Message
Category: HTML



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use