Client Side Events In HTML Page with .NET VB Class

Hi Im new to .NET so please excuse me.

Ive been scratching my head for a week now trying to convert some code from VB6 to .NET
I have currently this code in HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Default</title>
<META content="VBScript" name="vs_defaultClientScript">
<META content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<META content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<META content="VisualStudio.HTML" name="ProgId">
<META content="Microsoft Visual Studio.NET 7.0" name="Originator">
<SCRIPT language="vbscript" id="clientEventHandlersVBS">
<!--
Sub Button1_onclick
Usercontrol11.TestMe
End Sub
-->
</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout">
<INPUT language="javascript" id="Button1" style="Z-INDEX: 101; LEFT: 207px; WIDTH: 77px; POSITION: absolute; TOP: 68px; HEIGHT: 59px" type="button" value="Button" name="Button1">
<OBJECT id="Usercontrol11" style="Z-INDEX: 102; LEFT: 112px; WIDTH: 35px; POSITION: absolute; TOP: 89px; HEIGHT: 25px" classid="clsid:818F91A3-047D-4EF0-A85A-551B18248B97" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="926">
<PARAM NAME="_ExtentY" VALUE="661">
</OBJECT>
<SCRIPT language="vbscript">
<!--

Sub Usercontrol11_StatusMe(strText)
msgbox "Hello World Event Fired !!"
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
I current have an activeX control written in VB6 as follows:
Public Event StatusMe(strText As String)
Public Sub TestMe()
RaiseEvent StatusMe("Mike")
End Sub

This works and when I press button1 in IE the event triggers. The problem is I want to convert the ActiveX control to a VB.NET Class or usercontrol.. My HTML is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Default</title>
<META content="VBScript" name="vs_defaultClientScript">
<META content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<META content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<META content="VisualStudio.HTML" name="ProgId">
<META content="Microsoft Visual Studio.NET 7.0" name="Originator">
<SCRIPT language="vbscript" id="clientEventHandlersVBS">
<!--
Sub Button1_onclick
UserClass1.TestMe
End Sub
-->
</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout">
<INPUT language="javascript" id="Button1" style="Z-INDEX: 101; LEFT: 207px; WIDTH: 77px; POSITION: absolute; TOP: 68px; HEIGHT: 59px" type="button" value="Button" name="Button1">
<OBJECT id="UserClass1" style="Z-INDEX: 102; LEFT: 112px; WIDTH: 35px; POSITION: absolute; TOP: 89px; HEIGHT: 25px" classid="http:CTest.dll#CTest.cTestClass" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="926">
<PARAM NAME="_ExtentY" VALUE="661">
</OBJECT>
<SCRIPT language="vbscript">
<!--

Sub UserClass1_StatusMe(strText)
msgbox "Hello World Event Fired !!"
End Sub
-->
</SCRIPT>
</BODY>
</HTML>

My VB.NET Class is as follows: (CTest.dll)
Public Class cTestClass
Public Event StatusMe(strText As String)
Public Sub TestMe()
RaiseEvent StatusMe("Mike")
End Sub
End Class

The event will not fire when I now press the button on the HTML page. Any ideas what I am missing to get events to fire on the client side as all the propertys and methods of the class work just it will not fire any events.
Thanks in advance
Mikee.
0
mikeeball
6/9/2004 7:59:34 PM
asp.net.client-side 24353 articles. 0 followers. Follow

9 Replies
651 Views

Similar Articles

[PageSpeed] 25

why do you want to convert the client-side control to .NET exactly?

I mean, it relies on the framework being installed on every client machine, which is not the case with the current VB6 control, right?
RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadable

Jason Brown - MVP, IIS
0
Atrax
6/10/2004 5:34:15 AM
Hi,

Q.why do you want to convert the client-side control to .NET exactly?
A. Because all development here is moving over to .NET and I have been given the task of conversion of code.
Q.I mean, it relies on the framework being installed on every client machine, which is not the case with the current VB6 control, right?
A. This is not an issue as its an internet system and all client have the framework installed.
0
mikeeball
6/10/2004 8:52:57 AM
Just curious:

Why do you need this to be an ActiveX control? You probably can get around that with new .NET features...you can just use the server-side code to generate standard HTML controls...and use javascript to perform client side operations.
Let me know,
-Jeff
-Jeff Evans


Programmer Analyst


Triton Management Group, Inc.


http://www.tritonmanagementgroup.com
0
dotnetsp2
6/10/2004 4:18:31 PM
Jeff,

The client side class will talk to Tills on a bar and the tills use TCPIP linked on the client side private network.

The class will be the comms interface to collect information from the tills on the client side.
Regards
Mikee.
0
mikeeball
6/10/2004 7:36:08 PM
Mikee,

I'm not following what Tills is. But it sounds like your trying to have client-side info sent to a server-side process or something of the sort. Standard html controls can accomplish this by implementing asp.net webservices. There's basically a seamless communication between server and client.
Is this what you're trying to accomplish?
-Jeff Evans


Programmer Analyst


Triton Management Group, Inc.


http://www.tritonmanagementgroup.com
0
dotnetsp2
6/11/2004 4:03:31 AM
Jeff,

Sounds like what I need.
Tills are cash registers (we call them tills in the UK)
Each cash register is an FTP server on a local network say with IP adresses 10.0.0.1 for cash register 1 and 10.0.0.2 for cash register 2 on the client side.
What I need is to communicate to each cash register with an FTP connection on client side to collect a file of data and then send this to a ASPX page to do some processing and add entries into a SQLserver database on the server side.
Can I do this with a webservice ?
Regards
Mikee
0
mikeeball
6/11/2004 7:12:42 AM
Hello,

a sample program that illustrates the extensibility of the WebRequest class to implement an FTP pluggable protocol is described in the following article:
FTP Access with WebRequest...
BTW: A nice FTP component can you find here: FTP component written with fully managed code
Maybe these links are helpful for you.
Karsten
0
kbrocksi_SEC
6/11/2004 2:10:43 PM
Yo mikee (sounds kinda New York'ish doesn't it),

You have an interesting case, I would probably just recommend using the WebRequest class to read the file on the server side and allow the user to update that information via standard asp.net controls, then append the file on the server side, and write it back out. I don't know how you would do all of this will ftp://, but I'm sure kbrocksi's article suggestion will shed some light on that issue.
So how's that UK weather nowadays? I just saw Tony Blair at the Reagan funeral: not that it applies, or even matters.
-Jeff Evans


Programmer Analyst


Triton Management Group, Inc.


http://www.tritonmanagementgroup.com
0
dotnetsp2
6/11/2004 6:55:29 PM
Hi Mikee,

at the end of the thread the recomondation was to use a webservice. But in my case it's not possible, so had you found the reasen why your event isn't fire, now?
regards
Andreas
0
itadle
8/19/2004 11:48:02 AM
Reply:

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 (Asp.net) 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...

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in asp.net ( required field, range validator and others)..my question is the required field validator is a server side control. So does that mean that it does a post back?..is 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...

Jscript, moving from client-side to server-side (.NET)
Hey all I’m working translating a web-app written in client-side Jscript to run on the server-side as JScript.NET. Without needing to get too specific, I am using Jscript because the original page aggregated raw data to produce statistical results (this was done dynamically based on user 'sort-by' options). The final output is an html report that can be emailed. Because this is currently being done on the client side, as the raw data grows the load-time grows as well (to the point that has almost become unusable). I’m posting here to see if anyone has any experi...

When to use client side varidation and server side varidation in .net?
In .net or classic web application we can varidate user data either on client isde or server side. How to select which side varidate to be used? Thanks! Generally, I use both client and server validation. I make sure the input is in the correct format and reasonably valid on the client, then I verify the data on the server. The extent of validation also depends on the type of data that I need to validate.Here are a few references:Validating ASP.NET Server ControlsIntroduction to Validating User Input in Web FormsClient-Side Validation for ASP.NET Server ControlsSecurity Checklist...

communication between client side(java script) and server side in .net project
I have a question which is, when building a .net project, we are able to use server side code and client side code(java script). How do they communicate? Thanks Client Side coding works with the WebBrowser. So when ever you write client side code you have to keep browser compatability in your mind and you have to code. Server Side code works with Web Server (IIS) and it's ASPNET ISAPI's. The won't directly communicate with each other. But using AJAX you can all server side code from Client Side! Example article on Ajax@ http://www.devarticles.com/index2.php?option=content&task=...

.NET for client side?
Is this the idea of "Atlas" but using JavaScript rather than another technology? Atlas's goal is to abstract various browser implementations of DOM API and to ease out the developer's job to write rich client applications. Atlas hence makes use of the existing all-browser supported JavaScript to achieve this. Thanks for your reply.Let me convey my idea differently: I would like to author client side code using a class system. I recognise that Atlas is a technology for producing JS code, much in the same way that ASP.NET produces HTML for the browser.Will Atlas be m...

Client side events in TreeView (.NET 2.0)
Hello all, I am using a TreeView control on a page with  EnableClientScript property set to true and everything works fine.However I would also like to handle expanded event on the client side - what I mean exactly is that I want the default implementation to do it's work (expand the node), but I would also would like to perform my own operation. I assume I should add some call to Attributes collection, however I couldn't find any documentation on that. Is it at all possible?  Thank you in advance for all your help.   I' ve looked at the source generate...

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="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body>  <SCRIPT language="c#" runat="Server">  void Page_Load(object s, EventArgs e) {  if (!Page.IsPostBack)  {   Label1.Text = Label...

XMLHTTP in .Net
I'm trying to convert an ASP page that uses XMLHTTP. At first I removed the XMLHTTP code and used regular server side code. Now I'm finding the XMLHTTP code (or something like it) might be needed. The situation is that the page has a lot of data on it in text boxes and drop down lists and response is very slow each time we send data back and forth to the server. On the ASP page the XMLHTTP was used to limit the trips to the server and the amount of data sent back and forth. It was used in client side code to do things like populate a drop down list when the value in a different drop down ...

Perform JavaScript Client Side Confirmation from a VB.NET DataGrid
Hi, I when I delete an item from the database through a Datagrid I want to get a messagebox popingup to give me the choise to Confirm it...in case I clicked the wrong item....the way it works now it just deletes it....can any one help me with an Example I have no Idea how to do this...I found an article in C# but it didnt help me at all. here is my source code <asp:DataGrid ID="dgCustList" Runat="server" AutoGenerateColumns="False" DataKeyField="id" AlternatingItemStyle-BackColor="#F6F6F6" HeaderStyle-BackColor="#C4B58E" CellSpacing="0" CellPadding="2" GridLines="Vertical" Width="100%"...

server side or client side page?
a page that contain a validation control and starting a storeProcedures when the user click on a button --is considered as a client side page or as a server side page?it seems to me that in asp.net everthing is server side, where are the client side pages?thanks The sp is server side, but the validation can be on or the other, depending on how it's coded.ASP.Net has it's validations, so it's server side when using them.But you can also make validations via JavaScript, so that would be client side.Zath but the validation controls (like RequiredFiledValidator) is a client side va...

Local Client-side printing using server vb.net code?
Hi,Rather than use the window.print() command which is just a form dump.  I want to use vb.net code to do this as it has all the features necessary.I came across this useful article from developers.com.  http://www.developer.com/net/net/article.php/3102381However, when I run this it throws an exception because there is no default printer attached to the server.  Of course I don't want to print server side - thats no good.  But print client side.  The users would print to whatever print queue on the network they have connected to their own pc.I thought ...

In datawindow.net,access the database from client side event using javascript
In powerbuilder,for example,a datawindow has two columns:itemno,description. input an itemno,validate it.if not found from the database,return 1 to trigger itemerror event; if found,get the description of the item from the database,and fill it into the column "description". The question is how to fulfill the function in web datawindow,through web service? if so,I need an example to realize it. You will need to use AJAX or make a round trip on item change event. -- Dean Jones CEO PowerObjects http://www.powerobjects.com (612) 339-3355 Ext. 112 TeamSybase * *...

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...

Web resources about - Client Side Events In HTML Page with .NET VB Class - asp.net.client-side

Fat client - Wikipedia, the free encyclopedia
the name is contrasted to thin client , which describes a computer heavily dependent on a server's applications. A fat client still requires ...

Facebook Forms EMEA Client Council
Facebook announced the formation of its EMEA Client Council in a post in Spanish on the Facebook for Business page by vice president for Europe, ...

Facebook hires: Carsabi team, head of policy France, marketing mix science lead, client partners and ...
... Manager (Prineville) Chief Facility Engineer (Prineville) SMB Associate, French (Dublin) User Operations – Contract (Menlo Park) Client ...

Dropbox dumps popular email client Mailbox and photo service Carousel
Facing growing competitive pressures, Dropbox has dumped two of its flagship products, including smart email pioneer Mailbox.

Acquire Learning casts 'a very dark shadow' over its clients
The desperate and jobless are sold hope, but all they are buying is debt "You can hear it in how these clients talk," says a former call-centre ...

Never Complain To Clients Or Adversaries
Even trial lawyers that learn and have fun all the time deal with frustrations and have their gripes. But we should never share those gripes ...

Huge Creates New Global CMO, Client Services Roles
... Managing Directors Patricia Korth-McDonnell and Eric Moore into the newly created global roles of chief marketing officer and president-client ...

Dropbox is shutting down Mailbox, the popular email client
Dropbox acquired Mailbox, the extremely popular email client, way back in 2013, and unfortunately it's now time to say goodbye. That's right, ...

Chatting with coworkers, clients, friends and others is easy as Pie
... uses your companys domain). This also means that you can now set up teams to chat with people outside your company, including partners, clients, ...

Apple Says U.K. Surveillance Law Would Endanger All Clients
Apple Inc. outlined its opposition to a proposed U.K. surveillance law, saying threats to national security don’t justify weakening privacy and ...

Resources last updated: 12/29/2015 9:32:53 PM