Running a script from C#

M

MW de Jager

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
 
H

Hans Kesting

MW said:
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
 
M

MW de Jager

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top