473,416 Members | 1,785 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,416 software developers and data experts.

Are Postback and Round Trip to the Server the same thing?

Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the articles
always use controls and javascript that have the "runat=server" in them.
Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony
Mar 27 '07 #1
7 3340
Tony,
I think you may be missing part of the articles. A postback means
that information is sent to the computer as you have mentioned. A roundtrip
means that you have done a postback, and received data. The JavaScript
factor probably comes into play thanks to a technology called AJAX. AJAX is
basically a javascript framework that enables a web page to perform a
postback on only certain parts of the page, and not the whole page. Only the
portion that is under control by the AJAX routines is updated and worked on.
This avoids posting back a full page, causing flicker and longer delays.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony


Mar 28 '07 #2
Yes, that little progress bar indicates a standard postback, which is a
round trip to the server.
There are other ways to do round trips to the server that are virtually
invisible to the user, and less disruptive for them. The main way is AJAX.
AJAX makes web pages behave more like windows applications. Instead of
doing a normal postback, AJAX allows a web page to stay responsive to the
user while the web page communicates silently with the web server in the
background. AJAX is based on JavaScript and Xml.

Here's more info:
http://SteveOrr.net/articles/Ajax.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony

Mar 28 '07 #3
Hello Mark.

A postback means the page is sent to the server computer? A roundtrip means
you have sent a page to the server and it has sent back a reply?

I can't do javascript without AJAX? That's the way i interpret your reply,
and from what i read, that is not true.

I'm still unsure about client-side script. Does this mean that i should be
able to interact with the user in the web page without doing postback or
roundtrip?

Thanks,
Tony

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:em**************@TK2MSFTNGP04.phx.gbl...
Tony,
I think you may be missing part of the articles. A postback means
that information is sent to the computer as you have mentioned. A
roundtrip means that you have done a postback, and received data. The
JavaScript factor probably comes into play thanks to a technology called
AJAX. AJAX is basically a javascript framework that enables a web page to
perform a postback on only certain parts of the page, and not the whole
page. Only the portion that is under control by the AJAX routines is
updated and worked on. This avoids posting back a full page, causing
flicker and longer delays.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
>Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony



Mar 28 '07 #4
Hello Steve.

Thanks for your information. I will certainly need some time to read and
understand your article.

I thought it would be better for me to understand javascript and ASP.NET 2.0
before trying to getting into AJAX. Do you agree?

Thanks,
Tony

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:51**********************************@microsof t.com...
Yes, that little progress bar indicates a standard postback, which is a
round trip to the server.
There are other ways to do round trips to the server that are virtually
invisible to the user, and less disruptive for them. The main way is
AJAX. AJAX makes web pages behave more like windows applications. Instead
of doing a normal postback, AJAX allows a web page to stay responsive to
the user while the web page communicates silently with the web server in
the background. AJAX is based on JavaScript and Xml.

Here's more info:
http://SteveOrr.net/articles/Ajax.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
>Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony


Mar 28 '07 #5
Adding to the bits already mentioned. Here is the basic primer:

Everything on the world wide web (browser based Internet) uses request
(browser asking for something) and response (server replying with
information). There are two ways to request: GET and POST. GET is a request
that has no form collection associated and is generally associated with
either typing an address in the browser or clicking a link. POST is when you
are posting back form elements. A roundtrip is a complete cycle, including
both the Request (POST or GET) and Response.

NOTE: There is a Request object, which you can use to pull information sent
from the browser, and a Response object, which you can use to push
information back. This makes sense when you think about the cycle above.

In ASP.NET, by default, all elements are inside a <formtag, so every
control you touch contacts the server using POST, which is why Microsoft
calls it a PostBack. A roundtrip is a complete Request and Response, so it
includes both the Postback and the response to the postback.

NOTE: In ASP.NET, IsPostback is your friend. Most of your Page_Load shoudl
be in a block marked IsPostBack = False or "Not IsPostback", as you should
handle the majority of postback work in the control event that was fired
when the user clicked on something and caused the postback.

JavaScript can enrich the user experience by handling events client side.
For example, you have a set of dropdowns that are dependent on each other.
If the user selects Jaguar (car model), you want to respond with a list that
has S-Type, X-Type and XJ, for example. Using JavaScript, you can load all
of this into an array on the client side and adjust the text in the
dropdownlist based on user's model choice. This can be done without AJAX, as
you can hard code huge lists on the client.

AJAX, or Asynchronous JavaScript And XML is a blend of JavaScript and
XmlHttp Postback capabilities. Technicially, this does a post to a web
service and gets the new elements back. It is not considered a PostBack in
Microsoft talk, as the entire page is not refreshed, only the AJAX enabled
parts. This also can enrich the user's experience, especially on a slower
connection, as the page does not completely have to redraw. But, the lag
time for AJAX can still be noticeable on slow connections, so keep the
updates as small as possible.

Should you learn ASP.NET before AJAX? Probably, but not due to having to
learn one before the other, but rather to avoid biting off more than what
you can chew in one session. Should you learn JavaScript before AJAX? No, if
you are using Microsoft's ASP.NET AJAX, where you are not responsible for
learning the JavaScript. Then, should you learn JavaScript? Yes, unless you
want to rely on tools and their limitations. The deeper your understanding
of underlying concepts, the more valuable you become as an
employee/consultant, as most developers are lazy and do not learn what is
going on underneath the hood.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony

Mar 28 '07 #6
Hello Cowboy.

Thanks for your very intense and informative reply. It took me a little
while to ingest it and understand it.

Other questions that i have. Is there ever a situation where you have a
postback but not a round trip? I'm asking this because of what Mark
Fitzpatrick wrote in his reply to my question. I just can't imagine that a
browser would start a postback and the server not respond to complete the
round trip.

It sounds like you are suggesting that learning javascript is not necessary
to learn ASP.NET AJAX, but i should learn javascript to have an underlying
understanding of ASP.NET AJAX.

I am trying to learn javascript, but what i don't understasnd about what i
am reading, which is why i started this post in the first palce, is why do
the javascript articles/examples always use the asp: type of controls which
have the runat=server. If i want to use javascript for my purposes, should
i use the html buttons?

Thanks,
Tony

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:4B**********************************@microsof t.com...
Adding to the bits already mentioned. Here is the basic primer:

Everything on the world wide web (browser based Internet) uses request
(browser asking for something) and response (server replying with
information). There are two ways to request: GET and POST. GET is a
request that has no form collection associated and is generally associated
with either typing an address in the browser or clicking a link. POST is
when you are posting back form elements. A roundtrip is a complete cycle,
including both the Request (POST or GET) and Response.

NOTE: There is a Request object, which you can use to pull information
sent from the browser, and a Response object, which you can use to push
information back. This makes sense when you think about the cycle above.

In ASP.NET, by default, all elements are inside a <formtag, so every
control you touch contacts the server using POST, which is why Microsoft
calls it a PostBack. A roundtrip is a complete Request and Response, so it
includes both the Postback and the response to the postback.

NOTE: In ASP.NET, IsPostback is your friend. Most of your Page_Load shoudl
be in a block marked IsPostBack = False or "Not IsPostback", as you should
handle the majority of postback work in the control event that was fired
when the user clicked on something and caused the postback.

JavaScript can enrich the user experience by handling events client side.
For example, you have a set of dropdowns that are dependent on each other.
If the user selects Jaguar (car model), you want to respond with a list
that has S-Type, X-Type and XJ, for example. Using JavaScript, you can
load all of this into an array on the client side and adjust the text in
the dropdownlist based on user's model choice. This can be done without
AJAX, as you can hard code huge lists on the client.

AJAX, or Asynchronous JavaScript And XML is a blend of JavaScript and
XmlHttp Postback capabilities. Technicially, this does a post to a web
service and gets the new elements back. It is not considered a PostBack in
Microsoft talk, as the entire page is not refreshed, only the AJAX enabled
parts. This also can enrich the user's experience, especially on a slower
connection, as the page does not completely have to redraw. But, the lag
time for AJAX can still be noticeable on slow connections, so keep the
updates as small as possible.

Should you learn ASP.NET before AJAX? Probably, but not due to having to
learn one before the other, but rather to avoid biting off more than what
you can chew in one session. Should you learn JavaScript before AJAX? No,
if you are using Microsoft's ASP.NET AJAX, where you are not responsible
for learning the JavaScript. Then, should you learn JavaScript? Yes,
unless you want to rely on tools and their limitations. The deeper your
understanding of underlying concepts, the more valuable you become as an
employee/consultant, as most developers are lazy and do not learn what is
going on underneath the hood.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:e1**************@TK2MSFTNGP06.phx.gbl...
>Hello.

I'm trying to undetrstand ASP.NET 2.0 and javascript.

When i have a button and i click on it and i see the web broswer progress
bar at the bottom do something, does that mean that there is postback
occurring? Does that mean a round trip to the server occurred?

I keep reading javascript articles and tutorials that say "improve the
client-side experience to be more responsive and quicker", but the
articles always use controls and javascript that have the "runat=server"
in them. Doesn't that mean that the javascript is executed on the server?

Any help would be gratefully appreciated.

Thanks,
Tony


Mar 29 '07 #7
On Tue, 27 Mar 2007 21:05:13 -0400, "Tony Girgenti"
<tony(nospam)@lakesideos.comwrote:
>Hello Mark.

A postback means the page is sent to the server computer? A roundtrip means
you have sent a page to the server and it has sent back a reply?

I can't do javascript without AJAX?
No. You can do javascript with anything - so long as your client has
their javascript switched on. In general, for it to work, asp.net needs
javascript switched on.

You can't do Ajax without javascript.
>I'm still unsure about client-side script. Does this mean that i should be
able to interact with the user in the web page without doing postback or
roundtrip?
A postback is done by sending the form contents to the server either as
1) a form or as 2) a querystring.

Ajax sends content to the server using a 3rd method, which is a callback
- this is designed to return xml data to the client which can then be
inserted into the web page.

You can interact with the client using these callbacks - but there is a
round-trip - however that Ajax round-trip is faster because you cut out
the normal page loading - which is very code intensive.
Apr 1 '07 #8

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

Similar topics

1
by: Peter Row | last post by:
Hi, I have a web app, there is only really 1 aspx page (that the user never sees) the rest of the code is done in a DLL that implements HttpHandler. My app (which is a porting job from Vb6...
2
by: Yanir | last post by:
H I have to display a sortable list of columns(a table or so) - by click on the title of a column, the column would be the criteria to sort by I know datagrid is very conveniant, but I want to save...
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...
8
by: needin4mation | last post by:
I understand this is a asp.net group, but thought I would post this here for comments. I admit I have used this post in another group, but it has less traffic. Here's to hoping I'm just blind to...
2
by: Larry | last post by:
Is there a way to disable all the controls the instant any auto-postback controls are changed (resulting in a postback that takes a couple seconds), so that the user can't continue changing other...
1
by: Sehboo | last post by:
Ok, let me try it again. I am copying the header section from my page here - maybe I am missing something <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD ...
3
by: moondaddy | last post by:
I have an htm page that will be passing data to the server via parameters in a hidden iframe's aspx page. I not need the aspx page to return back to the htm page because the mission has already...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...
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.