473,466 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Running a script from C#

I am running a script from C#, but I need a returnvalue to be passed back to
my code.

I am currently using RegisterStartupScript, but this does not allow me to
receive anything back from the java script. Any ideas on how to do this?

Kind regards
MW de Jager
Nov 19 '05 #1
3 1305
MW de Jager wrote:
I am running a script from C#, but I need a returnvalue to be passed
back to my code.

I am currently using RegisterStartupScript, but this does not allow
me to receive anything back from the java script. Any ideas on how
to do this?
Kind regards
MW de Jager


When you do a RegisterStartupScript (or RegisterClientScript), the script
is added to the output that will be sent to the browser. Nothing is executed (yet).
Only when the server-side is done, the html (containing your script) is
sent to the browser, which then may execute that script.

To get a return value, you could write the result to a hidden input (that you
can read when the page is submitted again),
or redirect to some special url, with that result in the querystring.

Hans Kesting
Nov 19 '05 #2
Hans, here is what I'm trying to do.

I use RegisterStartupScript to run a javascript to do a showModalWindow.

This works fine, but I cannot get to the result that is passed back,

Hans,

I'm trying to make a dialog box (webpage) that will allow me to send back a
result like OK or Cancel etc.

I call some javascript that does a showModalDialog which works just fine.

Only problem is, I can't see the result in my C# code.

Any ideas, or is there another way to do this?

Kind regards
MW

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
MW de Jager wrote:
I am running a script from C#, but I need a returnvalue to be passed
back to my code.

I am currently using RegisterStartupScript, but this does not allow
me to receive anything back from the java script. Any ideas on how
to do this?
Kind regards
MW de Jager


When you do a RegisterStartupScript (or RegisterClientScript), the script
is added to the output that will be sent to the browser. Nothing is
executed (yet).
Only when the server-side is done, the html (containing your script) is
sent to the browser, which then may execute that script.

To get a return value, you could write the result to a hidden input (that
you
can read when the page is submitted again),
or redirect to some special url, with that result in the querystring.

Hans Kesting

Nov 19 '05 #3
MW de Jager try pasting some code..
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #4

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

Similar topics

8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
4
by: Damien Renwick | last post by:
I have a php script which simply stops midway through a while loop that processes records returned by a MySQL query. The HTML page continues trying to load the page but the php has stopped running...
10
by: shumaker | last post by:
I don't need a detailed description of a solution(although I wouldn't mind), but I am hoping someone could tell me in general the best path to go about accomplishing a task, since I don't know all...
1
by: Ennio-Sr | last post by:
Hi all! Testing a script where I need to make sure that postgresql is running before passing a <psql dbasename -c "insert into ..." > instruction I faced this curious behaviour: This is the...
2
by: Benjamin Rutt | last post by:
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
1
by: Aaron West | last post by:
Try this script to see what queries are taking over a second. To get some real output, you need a long-running query. Here's one (estimated to take over an hour): PRINT GETDATE() select...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
9
by: Scott | last post by:
What is the most reliable method to determine the folder a script is running in? I was looking at the globals in $_SERVER but all the variables also listed the actual file the script was running...
5
by: Christopher Brewster | last post by:
I am running the same script on the same data on two different machines (the folder is synchronised with Dropbox). I get two different results. All the script does is count words in different...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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 ...

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.