0% found this document useful (0 votes)
5 views3 pages

Unit 5

Uploaded by

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

Unit 5

Uploaded by

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

UNIT V ACTIVE SERVER PAGES

Creating interactive applications using active server pages : client and server side script in C#,

Assignment 5

1) Explain the active server page and the uses of active server page technology in web design
2) How Active Server Pages Work
3) What is client-side and server-side in C#?
4) How does a web client work with a server-side script or application?
5) How to call server-side function from client-side in ASP.NET c#?
6) How do I debug an ASP.NET application that wasn't written with Visual Studio.NET and that doesn't use code-
behind?

ACTIVE SERVER PAGES


An Active Server Page is a text file which resides on a Web server. When a Web client (browser) calls an Active Server Page the Web
server processes the code in the Active Server Page and returns standard HTML to the browser. The advantage Active Server Pages have
over standard HTML pages is that they are dynamic; the HTML sent to the browser is generated "on-the-fly" by the server and is
dependent on the previous actions of the browser user.
A browser calls an Active Server Page in the same way that it calls a standard HTML page. The only difference is in the file extension,
whereas HTML pages have extension htm or html, Active Server Pages have the extension .asp.
An Active Server Page looks like something like this:
<HTML>
<BODY>
<% For i = 3 To 7 %>
<FONT SIZE="<% = i %>">Hello World!<BR>
<% Next %>
</BODY>
</HTML>

An Active Server Page consists of scripting language statements and standard HTML code. To distinguish between the two we put the
scripting code in brackets <% %>
When the URL of the Active Server Page is entered in the browser, say
http://nt2.ec.man.ac.uk/coursesamples/example1.asp
the web server processes the Active Server Page code and would, in this example, return the following HTML
<HTML>
<BODY>
<FONT SIZE="3">Hello World!<BR>
<FONT SIZE="4">Hello World!<BR>
<FONT SIZE="5">Hello World!<BR>
<FONT SIZE="6">Hello World!<BR>
<FONT SIZE="7">Hello World!<BR>
</BODY>
</HTML>
The processing is invisible to the browser and the user and all they see is standard HMTL.

Active Server Pages Work


1) Client sends request
– Server receives request and directs it to ASP
– ASP processes, then returns result to client
2) HTTP request types
– Request methods
• GET
– Gets (retrieves) information from server
– Retrieve HTML document or image
• POST
– Posts (sends) data to server
– Send info from HTML form
» Client-entered data
» Info to search Internet
» Query for a database
» Authentication info
3) Browsers often cache Web pages
– Cache: save on disk
– Typically do not cache POST response
• Next POST request may not return same result
4) Client requests ASP file
– Parsed (top to bottom) by ActiveX component asp.dll
• ActiveX component: server-side ActiveX control that usually does not have GUI
• Code executed as encountered
• @LANGUAGE statement
– Specifies scripting language
– If not used, VBScript assumed
• As interpreted, HTML (plus client-side scripts) sent to client
– Parsed each time requested
– Web server must support ASP by providing component such as asp.dll

Client-side Scripting VS Server-side Scripting


1) Client-side scripting
– Used for:
• Validation
• Interactivity
• Enhancing Web page with ActiveX controls
• Dynamic HTML
• Java applets
• Accessing browser
– Browser-dependent
• Scripting language must be supported by browser or scripting host
– Viewable on client
• Protecting source code difficult

2) Server-side scripting
– Reside on server  more flexibility
• Database access
– Usually generate custom response for client
– Access to ActiveX server components
• Extend scripting language functionality
– Run exclusively on server cross-platform issues not a concern
– Not visible to client
• Only HTML + client-side scripts sent to client

Server-side ActiveX Components


1) Server-side ActiveX components
– Typically do not have GUI
– If scripting language for ASP not support certain feature, create ActiveX Server component
• Visual C++, Visual Basic, Delphi, etc.
– Usually execute faster than scripting language equivalents
– Executed on server
• Client does not need to support ActiveX technologies

Some server-side ActiveX components included with IIS and PWS

You might also like