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 <form> tag, 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!
*********************************************