473,769 Members | 3,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Javascript Function from within VB Procedure?

Dear Group

I'm using VB to write an aspnet application. I would like to call a
javascript function from within a VB Sub or VB Function, is it possible? My
code is something like this:

VB Code:
Public Sub VBProcedure()
..
..
Run some VB Code...
..
..
Now call the javascript function

End Sub
------------------------------------------------------
javascript:
<HEAD>
<script language=javasc ript>
<!--
// MyFunction
function myfunction() {
window.open()
}
//-->
</script>
</HEAD>

I tried javascript: myfunction() within the VB procedure. Well, it was just
a blind guess since the 'javascript:' syntax did not produce any errors.
What is 'javascript:' all about? I can't find it documented.

Thanks for your help & efforts!

Martin

Nov 20 '05 #1
4 6335
Cor
Hi Martin,

The most simple sample.

\\\
Dim str As String
str = "<script language=javasc ript> {window.open('h ttp://www.google.com' );}
</script>"
RegisterStartup Script("Startup ", str)
///

I hope this helps a little bit?

Cor
Dear Group

I'm using VB to write an aspnet application. I would like to call a
javascript function from within a VB Sub or VB Function, is it possible? My code is something like this:

VB Code:
Public Sub VBProcedure()
.
.
Run some VB Code...
.
.
Now call the javascript function

End Sub
------------------------------------------------------
javascript:
<HEAD>
<script language=javasc ript>
<!--
// MyFunction
function myfunction() {
window.open()
}
//-->
</script>
</HEAD>

I tried javascript: myfunction() within the VB procedure. Well, it was just a blind guess since the 'javascript:' syntax did not produce any errors.
What is 'javascript:' all about? I can't find it documented.

Thanks for your help & efforts!

Martin

Nov 20 '05 #2

Hi Cor

Thanks for your message.
Well, I'm not exactly sure whether that's the answer to my problem. After
having had a look at the RegisterScript Methods, it seems to me that it is
just a convenient way to inject the Javascript into the page. I can do this
by writing it directly in the HTML view in VS. Or is there a difference.
Once having the Javsscript registered, I still need a HTML button on my page
whick calls the Javascript in the OnClick Event.

However in my case, I'm calling a VB Sub with the OnItemCommand Event of the
Datagrid to look up some data depending on the value choosen nin the
datagrid. So the OnItemCommand for the datagrid is already taken. At the
same time when the OnItemCommand Event fires I also would like to execute a
client-side Javascript function after the data has been looked up.
So I thought I'm calling the Javascript from within the VB Sub in which I
look up the data after completion of look-up.

Any possible way to achive this?

Thanks for your help & efforts!

Kind Regards,

Martin

"Cor" <no*@non.com> wrote in message
news:#M******** ******@tk2msftn gp13.phx.gbl...
Hi Martin,

The most simple sample.

\\\
Dim str As String
str = "<script language=javasc ript> {window.open('h ttp://www.google.com' );} </script>"
RegisterStartup Script("Startup ", str)
///

I hope this helps a little bit?

Cor
Dear Group

I'm using VB to write an aspnet application. I would like to call a
javascript function from within a VB Sub or VB Function, is it possible?

My
code is something like this:

VB Code:
Public Sub VBProcedure()
.
.
Run some VB Code...
.
.
Now call the javascript function

End Sub
------------------------------------------------------
javascript:
<HEAD>
<script language=javasc ript>
<!--
// MyFunction
function myfunction() {
window.open()
}
//-->
</script>
</HEAD>

I tried javascript: myfunction() within the VB procedure. Well, it was

just
a blind guess since the 'javascript:' syntax did not produce any errors.
What is 'javascript:' all about? I can't find it documented.

Thanks for your help & efforts!

Martin


Nov 20 '05 #3
Hi Cor

Thanks for your message.
Well, I'm not exactly sure whether that's the answer to my problem. After
having had a look at the RegisterScript Methods, it seems to me that it is
just a convenient way to inject the Javascript into the page. I can do this
by writing it directly in the HTML view in VS. Or is there a difference.
Once having the Javsscript registered, I still need a HTML button on my page
whick calls the Javascript in the OnClick Event.

However in my case, I'm calling a VB Sub with the OnItemCommand Event of the
Datagrid to look up some data depending on the value choosen nin the
datagrid. So the OnItemCommand for the datagrid is already taken. At the
same time when the OnItemCommand Event fires I also would like to execute a
client-side Javascript function after the data has been looked up.
So I thought I'm calling the Javascript from within the VB Sub in which I
look up the data after completion of look-up.

Any possible way to achive this?

Thanks for your help & efforts!

Kind Regards,

Martin

"Martin Feuersteiner" <th************ @hotmail.com> wrote in message
news:c1******** **@sparta.btint ernet.com...
Dear Group

I'm using VB to write an aspnet application. I would like to call a
javascript function from within a VB Sub or VB Function, is it possible? My code is something like this:

VB Code:
Public Sub VBProcedure()
.
.
Run some VB Code...
.
.
Now call the javascript function

End Sub
------------------------------------------------------
javascript:
<HEAD>
<script language=javasc ript>
<!--
// MyFunction
function myfunction() {
window.open()
}
//-->
</script>
</HEAD>

I tried javascript: myfunction() within the VB procedure. Well, it was just a blind guess since the 'javascript:' syntax did not produce any errors.
What is 'javascript:' all about? I can't find it documented.

Thanks for your help & efforts!

Martin

Nov 20 '05 #4
Cor
Hi Martin,

I said that was the simplest one. And I have not direct the answer to your
datagrid, but look also look at this sample (you have to find the postback
event from the datagrid, than I think this will work than also).

\\\A webform with an imagebutton and two bitmaps in the solution map
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Me.ImageButton1 .ImageUrl = "bitmap2.bm p"
Me.ImageButton1 .Attributes("on mouseover") = "this.src='bitm ap1.bmp';"
Me.ImageButton1 .Attributes("on mouseout") = "this.src='bitm ap2.bmp';"
Me.ImageButton1 .Attributes("on Click") = _
"window.locatio n='mailto:no*@n on.com?subject= Cor demo&body=I hope this
helps?';"
End Sub
///

I hope this helps a little bit?

Cor
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
12699
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes state, the HTML page URL would change from default.html to default.html#stateA. example: http://pearstudios.com/javascript/locationHashAndFlash.html This has worked perfectly within HTML and javascript alone, however, when connecting Flash and...
30
2290
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several nested do loops, going through the records in rst using .movenext. At one point in one of the loops, we'll say the rst is at record "a". Now, another subprocedure is called, passing rst to it. In the subprocedure, the recordset goes through a...
4
4087
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is dependant on data collected in the code behind on the server. I have set AutoPostback to false for the controls and added lines such as cboMyCombo1.Attributes.Add("onchange", "MyCombos_OnChange('1')"); in the Page_Load event, which is rendered OK...
1
1554
by: Martin | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB Code: Public Sub VBProcedure() .. ..
3
4405
by: Shiraz | last post by:
Updated to the latest version of DBD-mysql using perl -MCPAN -e "install DBD-mysql" and now the calling mysql function r2() within perl work > $SQL_Text = "select r2() from dual " ; > $sth=$dbh->prepare($SQL_Text); > $sth->execute(); > while ( ($tt) = $sth->fetchrow_array( ) ) { print $tt; } for reference here is the mysql Funtion
5
2248
by: Stephen Plotnick | last post by:
I'm very new to VB.NET, or any VB. I need to have form1 call form2 which calls form3, etc. I am able to use oledb in form1 to get the data. I build all the data for form2 and form3 from form1 I can call form2 from form1 without any probles, all the data is there. I can change to call to form2 to form3 and all the data is there and I can see
13
1695
by: paragpdoke | last post by:
Hello Everyone. Merry Christmas to all ! I'm a JavaScript newbie (and new to thescripts.com too). And I have problems in working with objects in JavaScript. The problem: <a href="JavaScript:functionName(object);">Click me</a> Somehow it calls toString for the object and rather than it being processed as an object, it is processed as a string. Details: I'm trying to build a documentation UI (using VBA plugin mztools) and the objects I...
4
3588
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In the corresponding input field (text box) the user enters a new category order which gets stored in the...
9
3027
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript variable. This all works fine. However, I want it to loop within a javascript function every 5 seconds. The function does other stuff, so looping within this function is essential (I've simplified it in the example below). Any advice would be...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.