473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Displaying calculation result without reloading whole ASP page



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 -->
Jul 19 '05 #1
8 3994
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.

"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...


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 -->

Jul 19 '05 #2
On Sat, 5 Jul 2003 14:12:23 -0500, "Marvin Thompson"
<ma**@wavefront.com> wrote:
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.
"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...


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 -->


Jul 19 '05 #3
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.
"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...
On Sat, 5 Jul 2003 14:12:23 -0500, "Marvin Thompson"
<ma**@wavefront.com> wrote:
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.
"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...


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 -->

Jul 19 '05 #4
On Sat, 5 Jul 2003 23:20:28 -0500, "Marvin Thompson"
<ma**@wavefront.com> wrote:
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.
"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...
On Sat, 5 Jul 2003 14:12:23 -0500, "Marvin Thompson"
<ma**@wavefront.com> wrote:
>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.
>"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
>news:be************@ID-13547.news.dfncis.de...
>>
>>
>> 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 -->
>


Jul 19 '05 #5
Aspersion wrote on 06 jul 2003 in
microsoft.public.inetserver.asp.general:
On 05 Jul 2003 20:01:29 GMT, "Evertjan." wrote:
Aspersion wrote on 05 jul 2003 :
Thanks, but I don't want the user to know how the calculation works.
As for JavaScript, not everyone uses it.
You can do this with concealed iframes, but you will need clientside
code to realize this.


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.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #6
On 06 Jul 2003 12:51:14 GMT, "Evertjan."
<ex**************@interxnl.net> wrote:

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.
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.


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

Thanks for your thoughts.
Jul 19 '05 #7
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

"Aspersion" <as*******@exasperated.btopenworld.com> wrote in message
news:be************@ID-13547.news.dfncis.de...


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 -->

Jul 19 '05 #8
Another option is xmlhttp. I have a demo for this at
http://tinyurl.com/5luf. Scroll down to the dynamic listbox example.

Bob Barrows
Aspersion wrote:
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 -->

Jul 19 '05 #9

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

Similar topics

4
by: J. J. Cale | last post by:
Hi Obviously I'm new to PHP. I would like to be able to update a table in a page from a database on the server without reloading the page each time. Is this possible with PHP? TIA Jimbo
5
by: JStrauss | last post by:
Hello, I am having a problem getting some code to calculate/work in an ASP page. In the snippet below I am collecting some data (inthours1 and intrate1) and then want to calculate a value...
3
by: Richard | last post by:
Hey there, I have a textbox and a listbox. When a user types a number in the textbox, I want to get all the records from a MS Access DB but without reloading the page. I now have something...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
54
by: VK | last post by:
Mission statement: A mechanics to get text stream into browser from any Web location without reloading the current page. 1) This mechanics has to support *at the very least* IE 5.5 and higher...
28
by: beach.dk | last post by:
Hi, I'm trying to implement a simple hash algorith called rs_hash in javascript, but I cannot get a correct result. In c the code looks like this:
1
by: cgiscri | last post by:
I designed an Access database for a project. It consists of tables, queries, forms, reports and macros. Just about all the bugs have been worked out except for a summary page. In addition to a...
5
by: =?Utf-8?B?amVsbGU3OQ==?= | last post by:
Hi, I want to use a difficult Excelsheet as source for my calculation in a ASP.NET (C#) page. I have 5 input fields on my ASP.NET page and when I press the submit button I want to put these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.