|
 |
asp_discuss thread: How to execute a script in web server from browser without changing a page?,
Message #1 by "Tom Ho" <homer777@h...> on Fri, 23 Aug 2002 12:24:03
|
|
When a client click a check box (for example) in his browser, I want a
script located in web server executed, but the contents(the page) in the
browser do not change, except that check box checked changes its status.
Certainly, I do not write something like:
window.location(whatever.asp?item1="x"&item2="y");
If you layout a check box in a form, you need to click a "submit" button,
which is also what I try to avoid.
Another trick is to load the same page back, but it causes flush.
Can anyone tell a better solution?
Thanks so much.
Message #2 by matthew.cochrane@d... on Fri, 23 Aug 2002 15:10:47
|
|
2 ways I can think of (without going into nitty gritty detail):
1. Put the page in a frameset with a hidden frame (a frame with the height
or width set to zero). Use javascript to load the ASP script page into the
hidden frame when the checkbox is clicked.
2. Use javascript to open the ASP script page in a small popup window when
the checkbox is clicked. This will run the script and also display a
confimation message, and if you wanted you could put a "Close Window"
button on there so the user can close the pop-up.
Matt
---------------------------------------------
> When a client click a check box (for example) in his browser, I want a
s> cript located in web server executed, but the contents(the page) in the
b> rowser do not change, except that check box checked changes its status.
C> ertainly, I do not write something like:
> window.location(whatever.asp?item1="x"&item2="y");
> If you layout a check box in a form, you need to click a "submit"
button,
w> hich is also what I try to avoid.
> Another trick is to load the same page back, but it causes flush.
C> an anyone tell a better solution?
> Thanks so much.
Message #3 by "Tom Ho" <homer777@h...> on Tue, 27 Aug 2002 18:17:11
|
|
> 2 ways I can think of (without going into nitty gritty detail):
> 1. Put the page in a frameset with a hidden frame (a frame with the
height
o> r width set to zero). Use javascript to load the ASP script page into
the
h> idden frame when the checkbox is clicked.
> 2. Use javascript to open the ASP script page in a small popup window
when
t> he checkbox is clicked. This will run the script and also display a
c> onfimation message, and if you wanted you could put a "Close Window"
b> utton on there so the user can close the pop-up.
> Matt
Matt, your way 2 is cleaner and works very well,
though I have not tried way 1 yet.
Thanks a lot.
|
|
 |