473,568 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3939

"Bart Schelkens" <BS********@hot mail.com> wrote in message news:%2******** ********@TK2MSF TNGP11.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 RegisterStartup Script or RegisterClientS cript 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******** *****@tk2msftng p13.phx.gbl...

"Bart Schelkens" <BS********@hot mail.com> wrote in message news:%2******** ********@TK2MSF TNGP11.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 RegisterStartup Script or RegisterClientS cript 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 RegisterStartup Script() 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********@hot mail.com> ¦b¶l¥ó
news:ub******** ******@tk2msftn gp13.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******** *****@tk2msftng p13.phx.gbl...

"Bart Schelkens" <BS********@hot mail.com> wrote in message news:%2******** ********@TK2MSF TNGP11.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 RegisterStartup Script or RegisterClientS cript 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=JavaSc ript>"

js &= "function RefreshMainFram e(item){" & vbCrLf

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

js &= "}"

js &= "</script>"

RegisterStartup Script("Refresh MainFrame", js)

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

What did I do wrong?

"Lau Lei Cheong" <le****@yehoo.c om.hk> wrote in message
news:e$******** ******@TK2MSFTN GP14.phx.gbl...
Just use RegisterStartup Script() 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********@hot mail.com> ¦b¶l¥ó
news:ub******** ******@tk2msftn gp13.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******** *****@tk2msftng p13.phx.gbl...

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

news:%2******** ********@TK2MSF TNGP11.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 RegisterStartup Script or RegisterClientS cript 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********@hot mail.com> wrote in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I've put this code in a function that I call to register the script :
js = "<script language=JavaSc ript>"

js &= "function RefreshMainFram e(item){" & vbCrLf

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

js &= "}"

js &= "</script>"

RegisterStartup Script("Refresh MainFrame", 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 "RefreshMainFra me(..)" call after the function
definition (by the way, that "item" argument isn't used
in your code?)

"StartupScr ipt" 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.
"ClientScri pt" 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 RegisterStartup Script
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=JavaSc ript>"

js &= "function RefreshMainFram e(){" & vbCrLf

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

js &= "}" & vbcrlf

js &= "RefreshMainFra me()" & vbcrlf

js &= "</script>"

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

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

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

js &= "function RefreshMainFram e(item){" & vbCrLf

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

js &= "}"

js &= "</script>"

RegisterStartup Script("Refresh MainFrame", 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 "RefreshMainFra me(..)" call after the function
definition (by the way, that "item" argument isn't used
in your code?)

"StartupScr ipt" 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.
"ClientScri pt" 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 RegisterStartup Script
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
4199
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 version="1.0" encoding="UTF-8"?> <!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Michael Herren (private) -->
0
6795
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 the issue is. Thanks Ravi
1
6908
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
9223
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 C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
0
5644
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 connect to the DB I get the following exception at java.lang.ClassLoader$NativeLibrary.load(Native Method) at...
1
9606
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 and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the...
12
5899
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 says: usage: java fit.FitServer host port socketTicket -v verbose I think this is because I do not understand the jython mechanism for...
0
3260
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.5.0_11-b03, mixed mode, sharing)) and in both cases, get the following list returned from calling getDeclaredFields() on java.lang.ClassLoader via this code...
1
4294
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 Linux there is an error. The code that fails is the following: SchemaFactory factory = ...
0
3247
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
7693
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...
0
7916
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. ...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.