0% found this document useful (0 votes)
13 views9 pages

Unit 4

The document discusses advanced concepts in ASP.Net, including communication with web browsers, the role of IIS as a web server, and the functionality of response objects. It explains the use of cookies for maintaining state information and query strings for passing data in URLs. Additionally, it outlines various properties and methods associated with response objects that facilitate web application development.

Uploaded by

parthsonar77
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Unit 4

The document discusses advanced concepts in ASP.Net, including communication with web browsers, the role of IIS as a web server, and the functionality of response objects. It explains the use of cookies for maintaining state information and query strings for passing data in URLs. Additionally, it outlines various properties and methods associated with response objects that facilitate web application development.

Uploaded by

parthsonar77
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

Chapter No: 4 Advanced ASP.Net


4.1 Communication with Web Browser
W3C

(World Wide Web Consortium) The international standards


group for the World Wide Web (WWW or W3), funded by its
industrial members but operated principally by the
Massachusetts Institute of Technology (MIT), the Institute
National Research Informatics Automatic (INRIA), and the
Center for European Particle Research (CERN).

Web

See World Wide Web.

Web browser

See browser.

Web server

A program connected to the World Wide Web that furnishes


resources upon request from a browser. The requested
resource is usually identified by a URL.

World Wide Web

(WWW, W3) A distributed client/server information retrieval


system using multiple protocols on the Internet. The client is a
browser and the server is a Web server. Typical protocols
include HTTP, FTP, and Gopher. Also referred to as the Web or
the WWW.

WWW
Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

See World Wide Web.

IIS
IIS (Internet Information Server) is a group of Internet servers
(including a Web or Hypertext Transfer Protocol server and a File
Transfer Protocol server) with additional capabilities for
Microsoft's Windows NT and Windows 2000 Server operating systems.
IIS is Microsoft's entry to compete in the Internet server market
that is also addressed by Apache, Sun Microsystems, O'Reilly, and
others. With IIS, Microsoft includes a set of programs for
building and administering Web sites, a search engine, and
support for writing Web-based applications that access databases.
Microsoft points out that IIS is tightly integrated with the
Windows NT and 2000 Servers in a number of ways, resulting in
faster Web page serving.

A typical company that buys IIS can create pages for Web
sites using Microsoft's Front Page product (with its
WYSIWYG user interface). Web developers can use Microsoft's
Active Server Page (ASP)technology, which means that
applications - including ActiveX controls - can be imbedded
in Web pages that modify the content sent back to users.
Developers can also write programs that filter requests and
get the correct Web pages for different users by using
Microsoft's Internet Server Application Program Interface
(ISAPI) interface. ASPs and ISAPI programs run more
efficiently than common gateway interface (CGI) and server-
side include (SSI) programs, two current technologies.
(However, there are comparable interfaces on other
platforms.)

Microsoft includes special capabilities for server


administrators designed to appeal to Internet service
providers (ISPs). It includes a single window (or
"console") from which all services and users can be
administered. It's designed to be easy to add components as
snap-ins that you didn't initially install. The

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

administrative windows can be customized for access by


individual customers.

Microsoft has been criticized for IIS's susceptibility to


computer virus attacks such as Code Red and Nimda.

4.2 Response object


The response object is a utility tool for
responding to user’s requests, but it server
you the other useful functions as well.
For example: - you can selectively direct
users to other URLS on page when redirect
method. It also works with the buffering
function so you can send individual
completed portions while the user is waiting
for other processing to get done.
Response objects collections:
There is only one collection in the
response object that is cookies collection,
which contains the values of all cookies
that are to be sent to the browser in the
currant response.
Cookies values must be created before
they are made part of the response, one they
are part of the response, they are write-
only, which means you can determine their
means from response object but not their
values.
Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

Response objects properties:


1. Buffer: -This can be either true or
false & specifies whether output being
processed will be held in the buffer
until all output is ready for delivery.
It is set to true by default in ASP
3.0 & false in earlier versions.
2. Is client connected: -This property
may be true or false, depending upon
whether the browser still connected &
loading a page.
3. Expires: -The value of this property
is a number representing the minutes for
which a page is valid. If the user has
this page cached for less than the value
of expires, the caches paged will be
displayed otherwise a new page is
generated.
4. Expires absolute: -This property
keeps value of specific date & time will
when the page expires, regardless of how
old it is.
5. Status: -It contains the status value
& message that will be sent to the
browser in the event of an error & can be
used to indicate successful processing as
well. It uses string as value & message.

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

6. Cache control: -It contains whether


proxy servers cache the page. Not all
proxy servers honor this property. Set it
to public to allow caching & privet to
disallow. It uses a string value.
7. Char set: -This property adds the
name of character set that is in use to
HTTP on tent- type header & is a string
value.
8. Content type: -This property can be
used to set the HTTP content type for a
response. If it is not used, standard
“text- html” is used. It is a string
value.
9. PICS: -It a string value, adds to
header including whether the response
contains content with themes violence &
soon
Response objects methods:
1. Write (“string or other value”):
This method is used to write a string into
the overall response & is typically inserted
into HTML code at the location where you
want the response string to become part of
the page.
2. Redirect (“URL”):

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

This method tells the browser to load the


page or URL specified. The “302 object
moved” HTTP header is used to accomplish
this action.
3. flush ():
These method forces an emptying of the
buffer at the currant stage of processing.
It is useful for providing users a partial
response especially where the remaining
processing may take quite some time.

4. end ():
This method ends processing & returns
whatever has been completed so far.
5. clear ():
This method simply eraser the contents of
response buffer.
6. add header (“name” , “content”):
It adds a custom header to the response
with name & content values & must be
processed before any page content is sent.
7. Append to log (“log entry”):

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

This method adds a string to the web server


log entry for the response when the WCVWC
log file format is used.
8. Binary write (safe array):
This method is used to writing a data
contained in a variant-type safe array into
the output stream without character
conversion occurring output stream without
character conversion occurring.

4.3 Cookies: -
Stored on the client, cookies are small strings (often limited to 4K) of text
with a name and a value. Multiple cookies can be stored, but they are
relatively insecure (since users can find, read, and alter them). Cookies can
be stored as a text file or in the active memory of the client (usually a
browser). As an application developer, you can use the Response object to
read and write cookies (and thereby maintain state information across page
requests, form posts, and so on), so long as the user's browser is set to accept
them. Cookies are also useful because they can be set to last for the life of
the session or for a very long time. Another advantage of using cookies is
that the client must send data back to the server that created the cookie,
preventing other servers from improperly requesting cookie data.

What is cookie? How it works in browser?

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

A cookie is a small list of text that accomplishes request & pages as


between the web server & web browser. The cookie contains information of
the web application & it is read by the server whenever user visits the web
site.

A cookie provides useful needs in web application to store user


specific information. Example – when a user visits the website another time,
the stored on client-side.

Cookies are associated with website not on specific page. So, the
browser & server can exchange cookies information, no matter user request
to a web site or not. When you request a web page first time, the cookies
will be stored in local hard disk & when a user revisits the web site, the
browser works on a local hard disk.

If the cookie does exist, the browser sends cookies to web site along
with the user page request. Your application can have determined the date &
time user had visited to site last time.

You can might use the info to display message to check data &
perform any other useful function.

4.4 Query string


The query strings are the data that is appended
to the end of a page URL. They are commonly used to
hold data page numbers or such items or other data
that isn’t confidential.

Often we need to pass variables too transfer


the variable value from your HTML pages or from
.aspx web forms to the context of ASP.NET.

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA

BCA DEPARTMENT

From example: - if you search on Google for 07


BOND, you’ll be redirected to a new URL that
incorporates your search parameters.

http://www.google.co.in/ search? =007+BOND

The query string is the portion of the URL


after the question mark. In this case, it defines a
single variable named q, which contains “007 +BOND”
string.

Disadvantages are:

1. Information is limited to simple string.


2. The information is easily visible.

The query string collection is useful when


working on database applications.

Dr.Krunal Bhavsar

Ph.D in CS,MCA,B.Sc,CCNA,DCA

You might also like