I have what must be a very common design issue in web programming, probably discussed 2000 times already, but I can never find any mention by searching. In particular
I have a web page with a form, which is posted to the server when the user is finished. The next stop for the user might be a return to a list, or it might be to refresh the form, depending on circumstances. Which of the followng is better programming technique
1) Post the form data to an intermediate script which handles the database update, and then issues a response.redire ct to either the list or the original form depending on circumstance
2) Decide on the next stop using javascript on the client side, and post the data directly to that location -- either the script that generates the list, or the script that generates the form. Use an include directive at the top of both scripts to pull in the code that does the database updating (a big subroutine in a separate file). Each script decides whether an update is needed by checking posted data, if any
In the old days, IE used to give an annoying alert with any redirect, killing option (1), but now that seems to have changed. So the main disadvantage of (1) seems to be extra traffic to and from the client and maybe a bit of latency
The main disadvantage to option (2) seems to be that more code needs to be compiled for the list script and the form script, an extra 300 lines, even though an update might be required less than half the time either script runs
As I understand how ASP works, a script and all its include files are compiled the first time the script is hit, and they stay in memory for a while, so they are not recompiled every time. So the cost of extra lines of code would be more to compile the first time, and a bit more memory consumed. But how much? Is the difference trivial, or something to worry about
At one extreme, an ASP-driven website could consist of just one url, one file, which pulls in all the rest of the code with a long set of includes, and decides which code to execute and what to present to the user based on information in the request. At the other extreme, code can be atomized into dozens or hundreds of single-purpose files, and volley the user to the right next page using response.redire ct. From a pure server performance standpoint, would either extreme be the best type of application design? Or is the best somewhere in the middle? 1 1361
<<
...I have a web page with a form, which is posted to the server when the
user is finished. The next stop for the user might be a return to a
list, or it might be to refresh the form, depending on circumstances.
Which of the followng is better programming technique:
1) Post the form data to an intermediate script which handles the
database update, and then issues a response.redire ct to either the list
or the original form depending on circumstance.
2) Decide on the next stop using javascript on the client side...
Here's the concept I like to use:
ASP Design Tips - Post Back Page http://www.bullschmidt.com/devtip-postbackpage.asp
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: martin |
last post by:
Hi,
We have a heavily used production server and a table which logs every
hit on a web site. This table has grown large over time and we want to
clear it down as efficiently as possible. We would like to issue a
truncate table statement, but with millions of rows we are a bit wary
of how this will affect server performance. The alternative is to
delete is stages using rowcount but of course this will generate a
large amount of logging....
|
by: mmike |
last post by:
How does the ASP.NET output cache affect an httpS:// (SSL) connection?
Suppose I have a default.aspx page that has the following:
<%@OutputCache Duration="3600" VaryByParam="None" %>
Page_Load {
/* if 443 convert to http:// via Response.Redirect(..........) */
blah ......redirect to a simple port 80 connection as opposed to a 443
|
by: charlies224 |
last post by:
Hi,
I am using SQL 2000 and has a table that contains more than 2 million
rows of data (and growing). Right now, I have encountered 2 problems:
1) Sometimes, when I try to query against this table, I would get sql
command time out. Hence, I did more testing with Query Analyser and to
find out that the same queries would not always take about the same
time to be executed. Could anyone please tell me what would affect the
speed of the...
|
by: Brian W |
last post by:
Yet another editor problem
To reproduce do the following
1) Open a Webform and switch to HTML edit mode
2) Enter the Following (include spaces)
This is some text before <asp:hyperlink id="hl1" runat="server "
navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink> And
this is my text after the Hyperlink
|
by: Connie Edwards |
last post by:
The following page.aspx is a very simple sample. But when I try to load it, it just prints 'ABCDED' as against making it a link. So, I was wondering if this file will first need to be compiled before being used. And if it needs to be compiled, how to do it? I have only .NET framework SDK. Don't have Visual Studio.NET yet.
Thanks in advance for any help.
<script runat="server">
Sub Page_Load
link1.HRef="http://www.w3schools.com"
End Sub...
| |
by: tshad |
last post by:
I am just trying to decide whether to split my code and uses code behind. I
did it with one of my pages and found it was quite a bit of trouble.
I know that most people (and books and articles) like it because you can
split the code from the design. That is logical. But if you are the only
one working on the code, it seem a little overkill.
I use Dreamweaver to do my design and find it a bit of a hassle to have
multiple files open...
|
by: Daniel Walzenbach |
last post by:
Hi,
I have a web application which sometimes throws an “out of memory”
exception. To get an idea what happens I traced some values using performance
monitor and got the following values (for one day):
\\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During
Execution: 7
\\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
|
by: Bob Jones |
last post by:
Here is my situation:
I have an aspx file stored in a resource file. All of the C# code is
written inline via <script runat="server"tags. Let's call this page
B. I also have page A that contains some javascript code that calls
window.open. I pass the resource url of page B to Page A's window.open
call. Page B is then loaded and executed but none of the server-side
code is rendered. If I view the source of the page, the code (and page...
|
by: =?Utf-8?B?QWxCcnVBbg==?= |
last post by:
I apparently posted this in a wrong group ... one intended for pre-.Net
development using VB. Anyway...
I have a solution containing a project of Web pages, a project that contains
all my business objects, five Web Service projects and three Windows Services
projects. I'm only working with a relatively small portion of the code ...
primarily the business objects, Web pages and one of the Web Services ... but
I need to make sure that...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |