client side event handling

i want to use a windows .net control in a web page.

and want to handle the events at client end

i got the following code from

but its not working for me

event handling
<script for=myControl1 event="event1" language="javascript">           

function myControl1::event1
    alert('my messge');


placing the control on web page

<form id="Form1" method="post" runat="server">
<OBJECT id="mycontrol1" style="WIDTH: 416px; HEIGHT: 288px" 
height="288" width="416" 


3/20/2007 9:59:18 AM 24353 articles. 2 followers. Follow

8 Replies

Similar Articles

[PageSpeed] 52
Get it on Google Play
Get it on Apple App Store

 hi NC01,

thanks for the reply

if you have read my post carefully , i want to handle events of a windows control in the the browser ( client end ) . i am able to run it , its performing the tasks as desired ,

 but i also wanted to handle its events.

none of the links you have provided , mentions anything about handling ( sinking ) events .

3/20/2007 12:35:37 PM

I doubt very much that you can do that as a web page and a WinForm are 2 different things. You can host the WinForm in a web page, but I know of no way to connect the two so that the web form would know when to handle an event. You could pass a property to the web page, however.


3/20/2007 12:41:35 PM

of course we can do that

read this article

only thing its not working for me.Hmm

3/21/2007 7:04:30 AM

As I read that article, it says nothing about propagating events from a WinForm control to the browser.

Good luck with that,

3/21/2007 11:27:33 AM


the article has a statement in bold

"Firing and sinking events in Internet Explorer"

and the following code

<script for=myControl1 event="ErrorEvent(e)" language="javascript">   
 function myControl1::ErrorEvent(e) 
alert('Windows media reports an error: ' + e.Message);           
  loadTOCNode(1, 'summary');
3/24/2007 7:11:54 PM

Can't say that I have ever tried this, I would probably resort to an Applet, but your script tag must be case sensitve and also, the event you are handling will probably be case sensitive as well, try the code below:  

    <script for="mycontrol1" event="ErrorEvent(e)" language="javascript" type="text/javascript">
        function mycontrol1::ErrorEvent(e) {
            alert('Windows media reports an error: ' + e.Message);

Hope this helps!  Don't forget to mark the most helpful post(s) as Answer for the sake of future readers.  Thanks!

Josh Stodola ← Come check out my blog!
3/24/2007 9:14:00 PM

its not working

i am posting all my code

.net component code


Public Class UserControl1
    Inherits System.Windows.Forms.UserControl

    Public Event event1()

#Region " Windows Form Designer generated code "

'//////// some generated code  here

#End Region

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = "test"
        RaiseEvent event1()
    End Sub
End Class


usage in webpage

<OBJECT id="mycontrol1" style="WIDTH: 336px; HEIGHT: 224px" height="224" width="336" classid="WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" VIEWASTEXT>
	<script for=mycontrol1 event="event1" language="javascript">       
	function mycontrol1::event1()
		alert('my messge');

3/25/2007 10:35:16 AM

Similar Artilces:

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click ( and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

Help with client side events Vs. server side events
Hi, Can someone look as the following script and tell me why marking the check box doesn't generate a client side event eventhough there's: onclick="checkClick()"? marked.  Thanks in advance, Sivan <%@ Page Language="c#" %><HTML> <HEAD>  <meta name="vs_targetSchema" content=""> </HEAD> <body>  <SCRIPT language="c#" runat="Server">  void Page_Load(object s, EventArgs e) {  if (!Page.IsPostBack)  {   Label1.Text = Label...

"Push" messages to Atlas/Ajax Client or Client-side event handling of server messages
What I'm looking for is the ability for the client-side Ajax/Atlas GUI to be able to update itself when events occur on the server. The issue is that the events are triggered from a third party, and aren't triggered by postback. For example, let's say there's a Queue of data on the server, and each time a new item is added to the Queue, I want the client to recognize the addition and display the new item. Right now, the only way I can think of doing this is by setting up an Ajax timer and checking the state of the Queue on every timer tick. While this doesn't cause the page to refresh/postba...

Client side/server side event race.
 Hi.  I've got a page that 1) Takes some text fields as input2) Does some math calculations on the input (server side via a "calculate" button click)3) Then opens a new window with some detailed information (client side, via a "view report" button click)The server needs to "calculate" before the user can click "view report" so I start with "view report" disabled.  I've got input validation on the "calculate" click, and at the end, I enable the "view report" button.  Everything is working well wi...

Client Side events and Server side binding
I want to filter a dataset, server side and bind it to a select control. Problem is my filtering must be done based on the text written by the user in a text input. To get this text i'm using client side keyboard events. I tried to use client side binding and it works fine, but the problem is my dataset has more than 10000 rows, and so the performance is awful. Only thing i can do i think is to rebind the select control to a filtered dataset, improving performance. This is my code at the moment: In the aspx: static HtmlSelect _control = null; [WebMethod(EnableSession = true)] publi...

Client side event handling
I have the following function on a client side event for when a button in the detail view of a webdatawindow is clicked. This works fine, but is not much use. function WebDataWindowControl1_Clicked(sender, rowNumber, objectName) { if(objectName=="b_call") { confirm("You clicked the " + objectName + " column in row " + rowNumber) } } What I want to do is add some data to the confirm message. From the example I have seen on code exchange I should be able to add the following ...

List of client side function of extenders and controls for client side
Hello All,I am using AJAX control toolkit for my current project. Now I need to find out what client side functions I can call on an extender. Lets say I am using a PopControlExtender. Now I want to show the popup from a JS funtions.If I can do a guess then it would be something like this$find('ppce').show();From where I can find what client side functions I can call on those extensders. This is really a frusterating thing. I learn about extenders only from Learn tutorials, no help here and there. Can anybody please tell me where are documentations about all the extenders in the tool...

Call client side and server side events together.
I have one textbox on my aspx page.I want to validate amount in that textbox. If it exceeds 100 then the alert message should show that amount is bigger.And it should not go further. But if the amount is less than or equal to 100, then after checking the condition onclientside, it should to the server side TextChanged event.I have written a javascript function which is being called on "onchange" event of textbox and if the value is valid, then it should call serverside textchanged event of the same textbox.Please its urgent. Mark it as Answer if you find it Helpful.Shailen  ...

doing client-side action after server-side event ends
 I have a asp-button;I want it to perform a client-side action after completion of the sever-side action((like:calling a javascript function after the click event of the button ends); You can inject some javascript from the server side button click event so that when the page renders on the client side it will invoke the function or javascript fragment. You can use the method Page.RegisterStartupScript to inject javascript, or you can assign the javascript fragment to a literal control which would be interpreted when the page renders on client side.  Can u add some code snippe...

Stop execution of server side event from client side
Dear All  I have a text box and i wrote code on the server side event( On Text Change). So when i write something on the text box it goes to server and execute the server side code. Now i want to control this sever execution from client side. i mean i want to cancel this postback from client side under some conition. can anyone plz help me? Regards Sure if you let us know what you want to be done. here is an example <asp:textbox id="txtFile" OnTextChanged="javascript:RefreshPage();" Visible=true Width=500 Runat=server/> function RefreshPage() { &nb...

Server Side control invoking a Client Side event
I need to figure out how to get a server side control to process the "OnMouseOver" event. Since server side controls do not have the onmouseover event associated with them, how would you make for example, a DropDownList have a "OnMouseOver" event associate with it? The DropDownList must be server side. I guess the idea here is to set client-side events on the server-side control. Any help will be appreciated. You may try something like this: In server side code DDL1.Attributes.Add("onmouseover", "javascript:alert('Hi')") Th...

executing my own function @ server side for a client side event
hi all, I have a client side dropdownlist control with onchange event. I am calling form1.submit() method in onchange event. is it possible to catch that event at server side ???ThanksPrashanth.J Not if you call form1.submit(). Try replacing that with <%= ClientScript.GetPostBackEventReference(DropDownList1, string.Empty) %>; Then in the Page_Load handler server-side: private void Page_Load(object sender, System.EventArgs e){ if ( this.IsPostBack ) {  // Place any code that needs to be executed ONLY on a post-back here.  string eventTarget = (this.Req...

handle updated DataTable on server side and client side
Hi, I have a table that I am trying to get to do a partial rendering update when a client side timer expires so that the datagrid reflects any changes in the database that might have occured. I thought of retreiving the DataTable from server via PageMethod or a web-service. when the client request the page I initialize/ update the server's DataTable via a wcf call. (the aspx code behind calls the wcf client proxy method). Is it better to hold an Instance of that DataTable in the servers cache (initialize on the application on_start event and update it on the server usi...

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in ( required field, range validator and others) question is the required field validator is a server side control. So does that mean that it does a post back? it client side or server side control  The only controls that post back are buttons and other inputs where you set AutoPostback="True", such as a dropdownlist or a textbox.  Another way of posting back is using an UpdatePanel and placing a trigger in it for a specified control and/or event. All controls are considered clien...

Web resources about - client side event handling -

Anchor handling tug supply vessel - Wikipedia, the free encyclopedia
Anchor Handling Tug Supply (AHTS) vessels are mainly built to handle anchors for oil rigs , tow them to location, anchor them up and, in a few ...

New Facebook SDK For IOS Adds Automatic Error Handling, Improved Login UI
... software-development kit for iOS is now available for download , with significant enhancements including a beta test of automatic error handling ...

Handling Disputes and Refunds
Handling Disputes and Refunds

Facebook Shares Stats on How Users are Handling the Latest Privacy Changes
Facebook’s traffic has yet to be affected by the aggressive privacy changes it made at the beginning of December, from what data we can see — ...

Handling five billion sessi
... that provides app developers with reliable, real-time and actionable insights into their mobile apps. Skip to main content Sign in Search Handling ...

Customer Service Handling
This group is for people in customer service profession facing the customer either in person or over phone.

Wrap Camera HD - Ultimate Picture Editor with Unique Paper Handling on the App Store on iTunes
Get Wrap Camera HD - Ultimate Picture Editor with Unique Paper Handling on the App Store. See screenshots and ratings, and read customer reviews. ...

Dead domain handling page - Flickr - Photo Sharing!
Explore anearthling's photos on Flickr. anearthling has uploaded 1692 photos to Flickr.

Frank Rich Talks New York Media, Handling Criticism - Media Beat (2 of 3) - YouTube
In the second part of our three-part "Media Beat" interview with him, Frank Rich talks about leaving The New York Times to join New York magazine, ...

34% Rate Obama’s Handling of Government Spending As Good or Excellent
Voters continue to question President Obama's handling of issues related to government spending and taxes. A new Rasmussen Reports national telephone ...

Resources last updated: 12/15/2015 11:08:42 PM