Getting Started with ASP | Active Server Pages

Home  »  ASP  »  Getting Started with ASP



    To make any web site dynamic and interactive Microsoft created Active Server Pages used mostly on Windows servers only. Getting started with Active Server Pages : What are Active Server Pages ? Understanding the Client Server Model; How ASP differs from Client-Side scripting technologies; Running ASP Pages (Setting up personal Web Server, Setting up Internet Information Server, Using ASP without IIS or PWS); Creating your first ASP pages.

Contents



What are Active Server Pages?

ASP was "born" in November 1996 when Microsoft announced its design of an Active Platform. The Active Platform reflects Microsoft's ides about how a desktop computer and a server computer should communicate. It consists of two parts: the Active Desktop and the Active Server. The Active Desktop referes to the client side, or the user's side, where HTML files are displayed on a web browser. The Active Server refers to the server-side component. This consists of pages that can be interpreted by the server, hence the term Active Server Pages.

Active Server Pages contains two parts:
  • Programmatic code
  • Embedded HTML
The programming code can be written in a number of scripting languages. A scripting language is a particular syntax used to execute commands on a computer.

A program composed of commands from a particular scripting languages is referred to as a script.

Some popular Web=related scripting languages include VBScript and JavaScript. When creating as ASP page, you can use one of four programming languages.


  • VBScript - Similar to Visual Basic's syntax, the most commonly used scripting language for ASP.
  • JScript - Similar to JavaScript.
  • PerlScript - Similar to Perl.
  • Python - A powerful scripting language commonly used for Web development.

Asp page contain embedded HTML. This follows for existing static Web pages to be easily converted into dynamic ASP pages. An ASP page must contain an .ASP extension.




Understanding Client-Server Model

In a client-server model, two computers work together to perform a task. A client computer requests some needed information from a server computer. The server returns this information and the client acts on it. The internet runs on a client-server model. With internet the server is a particular Web server and the client is a web browser.
A web server is a computer that contains all the web pages for a particular web site and has special software installed to send these web pages to web browsers that request them.
The following steps occur when a web browser visits a static web page.
  1. The client (web browser) locates the web server specified by the first part of the URL (www.something.com)
  2. The client then requests the static web page specified by the second part of the URL (/index.htm)
  3. The web server sends the contents of that particular file to the client in HTML format


When a web browser requests an ASP page, the following steps occur:
  1. The client locates the web server specified by the first part of the URL (www.something.com)
  2. The client then requests the ASP page specified by the second part of the URL (/default.asp)
  3. The web server reads the ASP file and processed the code
  4. After the ASP page has been completely processed by the web server, the output is sent in HTML format to the client.
  5. The client receives the HTML sent by the server and renders it for the user.



Always Remember if a client Contains Some Programming suppose is a Client is using Some Scripting Language then all the Code of that Scripting Language is Processed on the Client Machine and then only the Request is sent to Server There is the Responsibility of Client Machine For Processing Script Code if a Client uses a Scripting Language in HTML then it is called as Client Side Scripting and all code is performed by Client Machine or Simply can say Client's Browser






How ASP differs from Client-Side Scripting Technologies?

Client-Server Scripting
Client –Side Scripting is Programming Code in HTML file that runs on browser or we can say that HTML Contains Some Scripting Code by using Script Tag then Browser will understand it as Client-Side Scripting and all processing is to be done on client Machine and Only the Request is sent to server.

Server-Side Scripting
Code of Asp is known as Server Side Script Means Code which doesn't use any script Tag and all the Processing is to be done by server Client only Request For a Page form Server by Supplying Some Information the Server will Execute Information that is given by client will be processed by server and only simple html format results are sent to clients.

Always Remember if a Program Contains both Client and Server Scripting then they are not Conflict with Each other because there is not interaction b/w Client and server side Scripting because client side scripting is processed by client machine and server side scripting is processed by server.






Running ASP Pages

For Running ASP Pages your computer may need to be running a web server Which Handles or provides the Ability for Making ASP Pages For Making an ASP Pages a Client just add or use any scripting language and a web server which handles Request of Clients Microsoft Provides us various types of Web Server for Making Web Pages with Compatible Environments Like different Web Servers are Available For Different Platforms or Windows

Personal Web Server
PWS is web server which is given by Microsoft absolutely free in Windows 98 se CD for Making ASP Pages which is Compatible to window 98 A User can install PWS only in Windows 98 When you Install a Server then Server will creates a default path for server from which Server Picks up the Request those are Sent by Clients The Default path is your windows Directory or where your windows is installed Suppose if your Windows is Installed on c:\ drive then the path of web server will be c:\intepub\wwwroot.

Internet Information Server
IIS is Microsoft 's Professional Web Server Which is Compatible with Windows XP and Widows 2000 IIS is Given by these windows Internally and wen can add this server by using as follows either your are using windows XP or Windows 2000:-
  • Click Start 's button and choose Setting
  • Choose Control Panel from Setting sub Menu
  • Choose Add/Remove Programs
  • Choose Windows Components from various options
  • Choose IIS and Click on Next Button
This will Take only 5 to 10 minutes then your server will be installed on your Computer and if you wants to check Server Either is Successfully installed on your Computer then do as follows:-

  • Click Start Button on Desktop
  • Choose Run Command
  • Type http://localhost/ and press Enter
If Server will Exists then it will open the default page of Server of First Page of Server But if your Server Doesn't installed then this will gives us an Error Message "The Page Cannot be Displayed ".






Creating Your First Web Pages

ASP pages, like regular HTML Web pages, are simply text files on the Web server. To create an ASP page, all you really need, after you've installed the Web server, is a text editor, such as Notepad.

Notepad is commonly used for creating and editing ASP pages, although it lacks the functionality of editors designed specifically for ASP development.

Let's create our first ASP page using Notepad. Start by opening up Notepad (choose Start - > Programs -> Accessories -> Notepad). Create an ASP page that display the message "This is my first ASP page".


You would need to save the file as MyFirstPro.asp and place it in your root physical directory, under C:\Inetpub\wwwroot\MyFirstPro.asp Now open up your browser of choice and enter the following into the Address window:

http://yourserver/MyFirstPro.asp

OR

http://localhost/MyFirstPro.asp








Share on Google Plus
    Blogger Comment
    Facebook Comment