ASP.NET Web Applications Overview
ASP.NET Web Applications Overview
Using [Link]
We will study mainly this area from the following resources:
1. Type the exact location and name of the page in the URL bar of the browser.
2. Save the page(s) on web server. It involves the following steps:
1. A web author writes a page composed of pure HTML, and saves it within an .htm file
on the server (computer).
2. Sometime later, a user types a page request into their browser, and the request is
passed from the browser to the web server
3. The web server locates the .html page and converts it to an HTML stream.
4. The web server sends the HTML stream back across the network to the browser.
5. The browser processes the HTML and displays the page.
They are quite limited without any dynamic features like displaying current time.
Also HTML offers no features for personalizing your web pages; each web page that
is served is the same for every user.
There's also no security with HTML, the code is there for everybody to view, and
there's nothing to stop you from copying somebody else's HTML code and using it in
your own web page.
Static pages might be very fast, as quick as copying a small file over a network, but
they are quite limited without any dynamic features.
A site that is reactive, like to display the current date and time.
A site which displays the values from an attached database file on the Internet like price of an
item,
A site to display a stock catalogue (web service),
Or you wanted to personalize your site to everyone who visited it, like administrator or user.
Client-Side Scripting:
In the client-side model, modules (or plug-ins) attached to the browser do all the work of creating
dynamic pages. The HTML code is typically sent to the browser along with a separate file containing
a set of instructions, which is referenced from within the HTML page. However, it is also quite
common to find these instructions intermingled with the HTML codes. So, in this model, our set of five
steps now becomes six:
1. A web author writes a set of instructions for creating HTML, and saves it within an
.html file. The author also writes a set of instructions in a different language (to
handle dynamic content). This might be contained within the .htm file, or within a
separate file.
2. Sometime later, a user types a page request into their browser, and the request is
passed from the browser to the web server. (When you type a web address like
[Link] in your web browser and press Enter, the browser sends a
request to the web server at that address. This is done through HTTP, the
HyperText Transfer Protocol. HTTP is the protocol by which web browsers and
web servers communicate. When you send the address, you send a request to
the server. When the server is active and the request is valid, the server accepts
the request, processes it, and then sends the response back to the client
browser.
Because you are using the built-in Development Web Server, the server and the
client are really the same machine. However, in a real-world scenario, you’ll host
your web site on an external web server where it can be accessed by many
different clients.).
3. The web server locates the .html page, and may also have to locate a second file
that contains the instructions (written in any scripting language).
4. The web server sends both the newly created HTML stream and instructions
back across the network to the browser.
5. A module within the browser processes the instructions and returns it as HTML
within the .html page – only one page is returned, even if two were requested.
6. The HTML is then processed by the browser which displays the page.
Everything you see, click, and interact with on a website is the work of front-end web development.
Client-side frameworks and scripting languages like JavaScript and Angular JS have made
interactive websites possible. Here’s a look at how this technology works in the scheme of a website,
and some of the most popular scripts and frameworks you should know.
The client is anywhere your users are viewing your site: mobile devices, laptops, or desktop
computers.
Client-side scripting is always evolving—it’s growing simpler, quicker, and easier to use. As a result,
sites are faster, more efficient, and less work is left up to the server. Server-side scripting works
in the back end of a site, which the user doesn’t see. It creates a way for the site to access its
database, all the behind-the-scenes mechanics that organize and power a website. Client-side code,
however, handles what the user does see.
Benefits of client side scripting:
Execute quickly because they don't require a trip to the server.
Are reusable and obtainable from many free resources
Create dynamic forms.
Drawbacks of client side scripting:
Client-side technologies have fallen out of favor in recent times, as they take a long time
to download, especially if we have to download a second file with a separate set of
instructions. In some cases, we might have to download several files of separate
instructions.
A second drawback is that each browser interprets these instructions in different ways, so
we have no way of guaranteeing that if Internet Explorer understands them, whether
Netscape Navigator or Opera will.
Other major drawbacks are that it is a problem to write client-side code that uses server-
side resources such as databases, because it is interpreted at client-side.
Also all code for client-side scripting is available to everybody, which can be undesirable.
Latest technologies in Client side Scripting:
Now that you’ve got a broad view of what front-end technology is and does, here’s a look at some of
the most widely used scripting languages and front-end frameworks. Languages are almost always
used in the context of their frameworks, which make quick work of complicated code with libraries of
pre-packaged, shareable code, and lots of add-ons. Your developer, in addition to HTML, CSS and
Java Script may use one or a combination of these when building the front end of your site. These
are actually frameworks of Java Script.
AngularJS: An incredibly robust JavaScript framework for data-heavy sites
JQuery, jQuery Mobile: A fast, small, JS object library that streamlines how JavaScript behaves
across different browsers
[Link]: A server-side platform that uses JavaScript, and is changing the way real-time
applications can communicate with the server for faster response times and a more
seamless user experience. It works with another JavaScript framework, [Link], to build
server-side Web applications.
Bootstrap: A mobile-first framework that uses HTML, CSS, and JavaScript to facilitate rapid
responsive app development
React, for user interface design
[Link], [Link], [Link], MeteorJS, and more
TypeScript: A compile-to-JavaScript language that is a superset of JavaScript, created by
Microsoft
AJAX (JavaScript + XML)—a technology that allows specific parts of a site to be updated without
a full-page refresh by asynchronously connecting to the database and pulling JSON– or XML-
based chunks of data.
VBScript & JScript are Microsoft’s front-end scripts that run on the [Link] framework. JScript
is Microsoft’s reverse-engineered version of JavaScript.
ActionScript, which creates animated interactive web applications for Adobe Flash Play
Java (as “applets”) snippets of back-end code that run independently with a run-time
environment in the browser
Tip:
It’s worth researching what browsers your primary audience is most likely to use, and what back-end
scripts and APIs you’re using, and then decide on a script based on a stack or compatibility.
Client-side scripting breakthrough:
An important breakthrough that changed the hard-and-fast rules for client side vs. server side? AJAX.
The old standard was that server-side processing and page post-backs were used when the browser
needed to interact with things on the server, like databases. AJAX, with its asynchronous calls to the
server, can pull the data instantly and efficiently, without requiring a post-back. Read more about how
it works in this AJAX Front-End Technology article.
Another major boost is jQuery, a fast, small, and feature-rich JavaScript library with an easy-to-use
API that works across a multitude of browsers. Like code libraries do, jQuery changed the way that
millions of people write JavaScript, simplifying a number of other client-side scripts like AJAX at the
same time.
Server-Side Scripting:
With the server-side model, the HTML source is sent to the web server with an intermingled set of
instructions. Again this set of instructions will be used to generate HTML for the page at the time
the user requests the page. Once again, the page is generated dynamically upon request. Our set of
five steps once more becomes six, however, with the subtle twist regarding where the processing of
instructions is done:
1. A web author writes a set of instructions for creating HTML (including the dynamic
part of the code), and saves these instructions within a file.
2. Sometime later, a user types a page request into their browser, and the request is
passed from the browser to the web server
3. The web server locates the file of instructions
4. The web server follows the instructions in order to create a stream of HTML
5. The web server sends the newly created HTML stream back across the network to
the browser.
Are the support, skills, and knowledge required to use them readily available?
History of [Link]:
ActiveX Controls:
An ActiveX control is a self-contained program (or component), written in a language such as C++ or
Visual BASIC. When added to a web page, it provides a specific piece of client-side functionality,
such as:
a bar chart,
timer,
client authentication, or
database access.
ActiveX controls are added to HTML pages via the <object> tag, which is now part of the HTML
standard. Despite being compatible with the HTML standard, they are not supported on any browser
without an ActiveX plug-in. Without this, they will only function on Internet Explorer. Also, unlike
VBScript, ActiveX is able to manipulate items on the user's machine such as the files or Windows
registry. For this reason it is very often considered a security risk and is not even allowed through
firewalls. Consequently, ActiveX controls still can't really be considered either a common or a cross-
platform way of making your pages dynamic and are falling out of use.
ASP:
Active Server Pages (ASP) is now dubbed (named formally) "Classic ASP" and if you see this term
in the book, we will be using it to describe any ASP that isn't [Link].
ASP commonly relied on either of the JavaScript or VBScript scripting languages (although it was
also possible to use any scripting language installed on Windows, such as PerlScript) to create
dynamic web pages. ASP is a module (the [Link] file) that you attach to your web server, and it then
processes the JavaScript/VB Script on the web server, and turns it into HTML, before sending it into
the server, rather than doing it on the browser. ASP lets us use practically any of the functionalities
provided by Windows, such as database access, e-mailing, graphics, networking, and system
functions, and all from within a typical ASP page.
ASP's shortcomings:
It is very, very slow performance wise.
It is also restricted to using only scripting languages. It can't do all the things that a fully-
fledged programming language can. Secondly, the scripting languages, being like
"junior" versions of full programming languages, took a lot of shortcuts to make the
language smaller. Some of these shortcuts make their programs more complicated
than is otherwise necessary.
As we're going to see, [Link] rectifies a lot of this by making code more structured, easier to
understand, and shorter.
[Link]:
[Link] also relies on a module attached to the web server. However, the [Link] module
(which is a physical file called aspnet_isapi .dll) doesn't do all of the work itself; it passes some on to
the .NET Framework to do the processing for it.
How does [Link] differ from ASP?
We add ASP code to our pages in the same way as we do client-side script, and this leads to
problems such as messy coding and restricted functionality. [Link] has no such problems.
First off [Link] allows you to use a far greater selection of full programming languages and
also allows you to utilize to the full the rich potential of the .NET Framework. It helps you create
faster, more reliable dynamic web pages with any of the programming languages supported by
the .NET Framework. Typical languages supported natively are [Link], C# and a new version of
JavaScript called [Link]. On top of this it is expected that third party developers will create
versions of Perl, Python, and many others to work in [Link]. We've chosen [Link] as its
arguably the simplest for beginners, and it can do pretty much anything that the other languages we
mentioned can as well. Lastly, and most importantly we've chosen [Link] as it comes free with
[Link] – so when you install [Link] you get [Link] as well.
A clean separation between presentation and code. With classic ASP, your programming logic was
often scattered throughout the HTML of the page, making it hard to make changes to the page later.
[Link] and [Link] (or C#)
At this stage, you might be thinking, "Hang on, I've got to figure out [Link], then I've got to get a
handle on [Link] – that sounds like an awful lot to learn." Don't worry; you won't be learning two
languages. [Link], as we said right from the beginning, is not a language – it is a technology. This
technology is accessible, via a programming language. What we're going to be doing is teaching you
[Link] features as we teach you [Link]. So in other words, you will be creating your web pages
using [Link] and using [Link] to drive it. However, before you rush out and get a [Link] book
instead, we will be approaching the language from the angle of creating dynamic web pages only.
In summation, ASP .NET is a server-side technology that lets us use fully-fledged programming
languages to create your web pages.
An introduction to [Link]:
[Link] is a framework (Set of libraries. It’s a part of .net framework) that supports the building of
robust and performant web applications.
Think of it as the structural support for a car. You can add a couple of different body designs on
top of this structure: [Link] Web Forms and [Link] MVC. These two approaches both rest on
[Link].
The current versions, Visual Studio 2010 (often pronounced as “twenty-ten”) and [Link] 4, build
on top of the successful Visual Studio 2008 and [Link] 3.5 releases, leaving many of the beloved
features in place, while adding new features and tools in other areas.
Now see in Beginning [Link] 4.5.1 (wrox’s book) from p. xxxiii. And follow this way to read:
1. Keep reading and highlighting the most important matters and also keep performing any
practical work along with.
2. After one chapter is finished, keep revising the highlighted text by copying the highlighted
text in the word file and arranging and remembering the text from this word file.
3. After that attempt exercises.
Client-side scripting is executed in the user's browser and handles the part of the site that users interact with directly, leading to quicker execution because it doesn't require communication with the server . Server-side scripting, on the other hand, occurs on the web server, which processes instructions to create dynamic HTML before sending it to the browser . Client-side scripting makes websites faster from the user's perspective as it reduces server load and response time, but it can be inconsistent across different browsers and may have security concerns as code is visible to users . Server-side scripting is more secure and consistent but can be slower as it requires server processes for every request .
Technologies like TypeScript and Express.js complement JavaScript by enhancing its capabilities and structure for building dynamic web applications. TypeScript, a superset of JavaScript, adds static typing and interfaces, which improve code readability, maintainability, and error checking at compile time, resulting in cleaner, more robust applications . Express.js, a minimalist web framework for Node.js, simplifies server-side programming with streamlined routing and middleware capabilities, allowing developers to handle requests and responses efficiently, enhancing JavaScript's usability for server-side applications . Together, they extend JavaScript's functionality in creating complex, scalable web solutions .
ASP.NET improves upon the limitations of traditional ASP by providing a more structured and efficient approach to web application development. While classic ASP scatters programming logic within HTML, making maintenance difficult , ASP.NET offers clean separation between presentation and code, simplifying updates and maintenance . Additionally, ASP.NET supports a greater variety of programming languages, allowing developers to use full-fledged languages like VB.NET and C#, which enhance performance and flexibility . ASP.NET also integrates seamlessly with the .NET framework, providing a richer set of functionalities and improved code management .
When choosing a scripting technology for mobile-first web development, several considerations are crucial. Compatibility with target platforms ensures that the technology works seamlessly across devices and browsers . Ease of learning and maintenance are practical factors affecting development efficiency, requiring accessible documentation and community support . Long-term viability and the technology's ecosystem, including the availability of libraries and frameworks, influence stability and extendibility . Furthermore, capabilities like responsiveness and performance, critical in mobile-first designs, should be prioritized, ensuring the technology can deliver a performant, user-friendly mobile experience . In summary, a balanced evaluation of these factors is key to successful mobile-first development.
Frameworks like Bootstrap and jQuery enhance front-end development by facilitating rapid development and improving cross-browser compatibility. Bootstrap, a mobile-first framework, uses HTML, CSS, and JavaScript to streamline responsive web design, making applications compatible across various devices . jQuery simplifies JavaScript programming with its easy-to-use API, which abstracts complex operations into simpler syntax, ensuring robust functionality across different browsers . Both frameworks offer extensive libraries and tools that reduce development time and improve site usability and design .
Using server-side frameworks like Django and ASP.NET has significant implications for building scalable web applications. Django, a Python-based framework, emphasizes rapid development and scalability with its 'batteries-included' approach, providing built-in features for authentication, ORM, and more . It allows developers to build applications quickly while maintaining performance as the user base grows. ASP.NET, part of the .NET framework, supports multiple programming languages and offers powerful tools for scalability, such as easy integration with databases and the ability to efficiently manage server resources . Both frameworks streamline development processes and enhance scalability, ensuring robust back-end performance as applications grow .
Modern client-side frameworks like AngularJS and React improve the development of data-heavy sites by providing robust, pre-packaged code that simplifies complex programming tasks. AngularJS helps manage heavy data through two-way data binding and dependency injection, which reduces the amount of boilerplate code needed . React optimizes user interface rendering by updating only parts of the page that need changing, making it efficient for high-performance applications . These frameworks streamline development processes by offering libraries and add-ons that support building complex data interfaces efficiently .
Node.js presents both advantages and disadvantages for web application development. Advantages include its ability to handle client-server communication efficiently due to its non-blocking, event-driven architecture, making it ideal for real-time applications . Node.js significantly decreases response time and supports active data-heavy operations, like chat rooms and news feeds, without bottlenecking . However, Node.js can become complex for CPU-intensive operations, as JavaScript isn't designed for heavy computation, potentially leading to performance bottlenecks . In summary, while excellent for I/O-heavy and real-time applications, it may not be optimal for computationally intensive tasks .
Challenges with client-side scripting include browser compatibility and security issues. Different browsers may interpret scripts differently, leading to inconsistent user experiences . For instance, a script that works in Internet Explorer might not function the same way in other browsers like Netscape Navigator or Opera . Additionally, since client-side code is visible to users, it poses security risks, as malicious users can view and potentially exploit the code . Furthermore, client-side scripts often require downloading additional files, which can slow down website performance if not optimized .
AJAX has transformed the conventional interaction between client-side and server-side processes by enabling asynchronous data loading, thus reducing the need for full-page reloads . Traditionally, any updates involving server data required a complete page refresh, halting user interactions and reducing website efficiency. AJAX, by allowing data transfer between the client and server in the background, permits portions of a web page to update independently, leading to smoother and more dynamic user experiences . This approach decreases server load and enhances performance as users can continue interacting with the page while updates occur .