Displaying calculation result without reloading whole ASP page

A

Aspersion

I'm building an ASP page that has a lot of text and graphics.

There is a calculation facility on the page. The user enters several
numbers in a form and presses a button to see the calculated answer.

The problem is this: when the user presses the Calculate button, the
whole page is reloaded and, on a large page, this is very noticeable.

Is there any way that I can get the calculation done and the result
displayed without reloading the whole page?

A simplified version of the page "calctest.asp" is shown below.

<!-- ignore html on usenet
<html>
<head>
<title>
This is calctest.asp
</title>
</head>

<body>
<h1>This is the test page</h1>

There are a lot of words and graphics displayed here.

<%
Var1 = trim(Request.Form("VarA"))
Var2 = trim(Request.Form("VarB"))
Var3 = Var1 * Var2
%>

<FORM Name=Calculation Action=calctest.asp Method=Post>
<input type="text" name="VarA" size="2" value=<%=Var1%>>
&nbsp;
<input type="text" name="VarB" size="2" value=<%=Var2%>>
&nbsp;
<input type="text" name="VarC" size="3" value=<%=Var3%>>
&nbsp;
<INPUT Type="Submit" Value="Calculate" Name="btnSubmit">
<p>
</FORM>

</body>
</html>
end ignore html on usenet -->
 
M

Marvin Thompson

If the calculation is simple and you do not care if the user sees the
algorithm, do the calculation in JavaScript and do not go back to the
server.
 
A

Aspersion

If the calculation is simple and you do not care if the user sees the
algorithm, do the calculation in JavaScript and do not go back to the
server.

Thanks, but I don't want the user to know how the calculation works.
As for JavaScript, not everyone uses it.
 
M

Marvin Thompson

OK, you can hide the algorithm with an include file. As for JavaScript,
only IE understands VBscript. All browsers understand JavaScript. All
client side scripting requires that you learn JavaScript. Server side
scripting can be VBscript. Good luck.
 
A

Aspersion

OK, you can hide the algorithm with an include file. As for JavaScript,
only IE understands VBscript. All browsers understand JavaScript. All
client side scripting requires that you learn JavaScript. Server side
scripting can be VBscript. Good luck.

Thanks for the input. When I said that not everyone uses JavaScript, I
meant that some people, including me, have it disabled on their
machine for security purposes.

The reason I want to handle the whole process server side is so that
any client configuration will see the same website.

BTW, include files don't hide your client side code from the really
determined. If their computer can read it, they can read it.
 
E

Evertjan.

Aspersion wrote on 06 jul 2003 in
microsoft.public.inetserver.asp.general:
Thanks, but I don't want any client side code. The whole process must
run on the server.

That is what I said. The proces runs on the server, but either you load a
new page everuy time or you use clientside code to load the output in a
concealed iframe and then using it on your initial page.

That is your choice
Some users disable JavaScript

You mean, I think, some users disable clientside code, this can be
javascript and [in IE] vbscript, just as serverside code can be in
javascript, vbscript, and many more.
and, besides, I don't want to make the code visible.

The code of your secret algorithm is not accessable, as it stays
serverside. only the code to enter the result on the clients screen
without a total refresh is clientside.
That leaves me with the original problem: how do I refresh a box on
the page to show a calculated result without having to re-send the
whole page?

Impossible without clientside scripting.
 
A

Aspersion

That is what I said. The proces runs on the server, but either you load a
new page everuy time or you use clientside code to load the output in a
concealed iframe and then using it on your initial page.

Iframes are limited. Like other frames, they're not very search engine
friendly. I'm also left with the client side code problem. You can't
depend on the client machine to run your code properly.
Impossible without clientside scripting.

I thought that, but I was hoping somebody knew better.

Thanks for your thoughts.
 
L

Linda

Have you tried using Remote Scripting? The premise of this technology is
that it will do calculations without reloading the whole page. It's

tricky...you'll have to read the documentation on it carefully, (and it
doesn't work in Netscape) but, if you have a specific audience that uses

only IE it can be your answer.

Good luck,

Linda
 

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,020
Latest member
GenesisGai

Latest Threads

Top