473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Java-script and vb.net

Hi,

how can I execute a piece of Java-script after a piece of vb-net-code has
been executed?

Thx
Nov 18 '05 #1
6 3930

"Bart Schelkens" <BS********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

how can I execute a piece of Java-script after a piece of vb-net-code has
been executed?

Thx


javascript should (probably, I don't exactly know what you want to do) execute
on the client-side, and vb.net on the server side. There is NO way to mix execution
on these two platforms. (unless you are prepared to solve some complicated
communication issues)

You CAN use RegisterStartupScript or RegisterClientScript to generate (java)script
from server side code, which can get executed when it finally arrives on the client.

Hans Kesting
Nov 18 '05 #2
Hans,

the problem i'm trying to solve is this:

My website consists of 2 frames.
I have a button in Frame1 that checks some things on my database.
According to the result of those checks, I need to refresh my Frame2.
I got some java-script to refresh my screen but I can't get it executed at
the correct time.
And apparently there's no VB.Net code to get the same result.

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:Ot*************@tk2msftngp13.phx.gbl...

"Bart Schelkens" <BS********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

how can I execute a piece of Java-script after a piece of vb-net-code has been executed?

Thx


javascript should (probably, I don't exactly know what you want to do)

execute on the client-side, and vb.net on the server side. There is NO way to mix execution on these two platforms. (unless you are prepared to solve some complicated
communication issues)

You CAN use RegisterStartupScript or RegisterClientScript to generate (java)script from server side code, which can get executed when it finally arrives on the client.
Hans Kesting

Nov 18 '05 #3
Just use RegisterStartupScript() or even a Literal WebControl to insert your
javascript to refresh frame2.

When your server-side code finished, the browser will reload and case the
scripts to be excuted.

Actually, I think when the page reloads, your frame2 should be refreshed
automatically. If it does not
seems to refresh, try disable the cache and set expire at "page" tag first.

"Bart Schelkens" <BS********@hotmail.com> ¦b¶l¥ó
news:ub**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
Hans,

the problem i'm trying to solve is this:

My website consists of 2 frames.
I have a button in Frame1 that checks some things on my database.
According to the result of those checks, I need to refresh my Frame2.
I got some java-script to refresh my screen but I can't get it executed at
the correct time.
And apparently there's no VB.Net code to get the same result.

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:Ot*************@tk2msftngp13.phx.gbl...

"Bart Schelkens" <BS********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

how can I execute a piece of Java-script after a piece of vb-net-code has been executed?

Thx


javascript should (probably, I don't exactly know what you want to do)

execute
on the client-side, and vb.net on the server side. There is NO way to mix execution
on these two platforms. (unless you are prepared to solve some

complicated communication issues)

You CAN use RegisterStartupScript or RegisterClientScript to generate

(java)script
from server side code, which can get executed when it finally arrives on

the client.

Hans Kesting


Nov 18 '05 #4
I've put this code in a function that I call to register the script :
js = "<script language=JavaScript>"

js &= "function RefreshMainFrame(item){" & vbCrLf

js &= "window.open('homepage.aspx','mainFrame');" & vbCrLf

js &= "}"

js &= "</script>"

RegisterStartupScript("RefreshMainFrame", js)

The script is registered fine, but it doesn't execute.

What did I do wrong?

"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:e$**************@TK2MSFTNGP14.phx.gbl...
Just use RegisterStartupScript() or even a Literal WebControl to insert your javascript to refresh frame2.

When your server-side code finished, the browser will reload and case the
scripts to be excuted.

Actually, I think when the page reloads, your frame2 should be refreshed
automatically. If it does not
seems to refresh, try disable the cache and set expire at "page" tag first.
"Bart Schelkens" <BS********@hotmail.com> ¦b¶l¥ó
news:ub**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
Hans,

the problem i'm trying to solve is this:

My website consists of 2 frames.
I have a button in Frame1 that checks some things on my database.
According to the result of those checks, I need to refresh my Frame2.
I got some java-script to refresh my screen but I can't get it executed at
the correct time.
And apparently there's no VB.Net code to get the same result.

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:Ot*************@tk2msftngp13.phx.gbl...

"Bart Schelkens" <BS********@hotmail.com> wrote in message

news:%2****************@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> how can I execute a piece of Java-script after a piece of
vb-net-code has
> been executed?
>
> Thx
>
>

javascript should (probably, I don't exactly know what you want to do)

execute
on the client-side, and vb.net on the server side. There is NO way to mix
execution
on these two platforms. (unless you are prepared to solve some

complicated communication issues)

You CAN use RegisterStartupScript or RegisterClientScript to generate

(java)script
from server side code, which can get executed when it finally arrives

on the client.

Hans Kesting



Nov 18 '05 #5

"Bart Schelkens" <BS********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
I've put this code in a function that I call to register the script :
js = "<script language=JavaScript>"

js &= "function RefreshMainFrame(item){" & vbCrLf

js &= "window.open('homepage.aspx','mainFrame');" & vbCrLf

js &= "}"

js &= "</script>"

RegisterStartupScript("RefreshMainFrame", js)

The script is registered fine, but it doesn't execute.

What did I do wrong?


You specified a function, but didn't call it anywhere.
Add a "RefreshMainFrame(..)" call after the function
definition (by the way, that "item" argument isn't used
in your code?)

"StartupScript" is rendered at the end of the page,
so everything important should already exist before
any script tries to access it, but you still have to *call*
functions.
"ClientScript" is rendered at the start of the page,
so that functions defined in that block are available
when they are referenced later.

A note: the first parameter of RegisterStartupScript
doesn't specify "a function to be called", but is just
a server-side identification string. If you can generate
this script from multiple places (it's in a control, and you
might use multiple copies of that control), then you
can use this identification to find out if it's already generated.

Hans Kesting
Nov 18 '05 #6
You mean that i should write it like this :

js = "<script language=JavaScript>"

js &= "function RefreshMainFrame(){" & vbCrLf

js &= "window.open('homepage.aspx','mainFrame');" & vbCrLf

js &= "}" & vbcrlf

js &= "RefreshMainFrame()" & vbcrlf

js &= "</script>"

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...

"Bart Schelkens" <BS********@hotmail.com> wrote in message

news:%2****************@TK2MSFTNGP12.phx.gbl...
I've put this code in a function that I call to register the script :
js = "<script language=JavaScript>"

js &= "function RefreshMainFrame(item){" & vbCrLf

js &= "window.open('homepage.aspx','mainFrame');" & vbCrLf

js &= "}"

js &= "</script>"

RegisterStartupScript("RefreshMainFrame", js)

The script is registered fine, but it doesn't execute.

What did I do wrong?


You specified a function, but didn't call it anywhere.
Add a "RefreshMainFrame(..)" call after the function
definition (by the way, that "item" argument isn't used
in your code?)

"StartupScript" is rendered at the end of the page,
so everything important should already exist before
any script tries to access it, but you still have to *call*
functions.
"ClientScript" is rendered at the start of the page,
so that functions defined in that block are available
when they are referenced later.

A note: the first parameter of RegisterStartupScript
doesn't specify "a function to be called", but is just
a server-side identification string. If you can generate
this script from multiple places (it's in a control, and you
might use multiple copies of that control), then you
can use this identification to find out if it's already generated.

Hans Kesting

Nov 18 '05 #7

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

Similar topics

2
by: Michael | last post by:
Hello I am trying to write a Java-Program which converts a XML-file in a HTML. It should take the Transformation-file from the XML-file itself. Below find a possible XML-file: <?xml...
0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
0
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build...
1
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.