...

View Full Version : Help converting a code from VB to Javascript



jason_kelly
10-12-2011, 08:21 PM
Hello,

I need your help.

How can I convert the following code to Javascript:



'SEARCH BY FILE NUMBER IN FILE NUMBER WHEN THE ENTER KEY IS PRESSED
Private Sub h1_KeyDown(ByVal KeyCode As msforms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
KeyCode = 0
Call btn_search_Click
End If
End Sub


Thanks for all your help in advance

J

Old Pedant
10-12-2011, 11:15 PM
You can't.

That is *SERVER-SIDE* code. I assume VB.NET in ASP.NET, yes? (Though it could be VB6 in an old fashioned ActiveX DLL, I suppose.)

In any case, you can't replace server-side code with client-side JavaScript.

The comment says "Search by file number in file...". You can't search in files in the browser. That has to be done server-side.

If I'm wrong in my assumptions, then show me more of the page that contains that snippet.

*****

EDIT: Yeah, I think I'm definitely right.

msforms.ReturnInteger
msforms means this is for a NON-web based application, right? Using windows forms? The logic is going to be completely different with browser-based code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum