learn asp nice and easy
hay guys its my first thread so plz stay calm in casse of any mistake and do let me know
overview of asp
ASP stands for Active Server Pages. ASP is a server side technology which is used to display dynamic content on the web pages. ASP is becoming popular day by day as the favorite server side technology. ASP in itself isn't a language actually, instead it uses VBScript or JScript to display dynamic content. ASP is more of a technology used by VBScript / JScript on the server side. So if you know VBScript or JScript you can start creating .ASP pages right now.
I will assume here that you are not familiar with VBScript, the language of choice for creating ASP pages. So I will also give you a little insight into VBScript too. But a general understanding of HTML is required.
You must be wondering what is required to run an ASP page ? well if you are running windows then you can download Personal Web Server ( for Win95 & Win98 ) or Internet Information Server ( for WinNT ) from www.microsoft.com. If you are running Windows 2000 then you have got IIS 5 already, you just need to install it. Just go to the 'control panel' and click the 'Add/Remove Programs' icon. Then on the left click the 'Add/Remove Windows Components' button, a window will appear offering you a lot of choices. Just check where 'Internet Information Services' is written and click 'Next', your IIS 5 will be installed. For those of you who are running other operating systems please take a look at www.chilisoft.com. They offer ASP solution for those of us not running Microsoft Windows. Please note that Chilisoft products are not free but you can download PWS or IIS free of cost from Microsoft's web site above.
Installing Personal Web Server
If you are running Windows 95/98 then you will most probably be needing PWS to run .asp pages. Just in case if you don't know what PWS stands for, PWS stands for Personal Web Server. If you have got Windows CD with yourself then you can install PWS from there. Or if you want then you can download the latest version of Personal Web Server from www.microsoft.com. Installation is all very easy. Just run the setup file and PWS will install just as any other application is installed on your system. I will advise you to accept the defaults when it comes to giving the location as to where the 'inetpub' and 'wwwroot' directories should be installed. Once the setup finishes you will most probably be ready to run the PWS.
After the installation of PWS, you will find a PWS icon on your desktop and probably a PWS small icon in the tray on the right lower corner of your desktop too. Double click any of them to bring up the PWS control window. If the PWS is already running then you will see an option 'Stop PWS'. But if PWS has been stopped and is not running then you will see the option to 'Start PWS'. Since we want to check that PWS has installed successfully and everything is running optimally, you should start the PWS if it is not already running. If it has started on its own then don't do anything.
Ok, now we want to check if PWS is running correctly and Active Server Pages are running or can be run. Open your Internet browser e.g. Microsoft Internet Explorer. In the URL box enter http://127.0.0.1 and press enter. If all is well then you will see a default page generated by PWS. When you install PWS it also sort of builds a default web site on your system, and that is what we tested here. If you can see some page then PWS is running correctly and we are done. But if PWS is running and you cannot see any page by entering the above URL then you might need to restart your computer and then start PWS again and then open your browser and enter the URL as given above. Hopefully everything will be alright now. Installation of PWS is very eay and most of times everything is done without any problems.
Note that to see .asp pages you cannot see them just be opening them in browser without the 'http' protocol. You have to append http://127.0.0.1/ before the page name and address to see it running on your own local computer. More on that later. For now you have successfully installed PWS and now we are ready to create some simple Active Server Pages.
Your first ASP page
Open you favorite text editor ( notepad ). ASP pages may be developed using expensive editors like Microsoft Visual Interdev but that is out of scope as far as this tutorial is concerned. So notepad is all we need.
Here we will be using VBScript for writing .asp pages. Note that you can also use JScript or PerlScript to write Active Server Pages. Write down the following in your notepad :
Well this is simple HTML and has no ASP code. Don't worry we'll be adding our ASP code on it. Now add the following line at the top of your <html> tag ( see above ) in your notepad.
<% @ Language=VBScript %>
Yes thats our first ASP code. This line tells the ASP code parser that we will be using VBScript to write code in this .asp page. If you would later want to use JScript or PerlScript then you might add JScript or PerlScript as the case may be in place of VBScript. But for now we will stick to VBScript. Ok, done that ? now add the following code between the <body> and </body> tags.
<% Response.Write "Hello World!" %>
Now save the page as 'helloworld.asp' in your c:/inetpub/wwwroot directory or where your wwwroot directory exists. Open your browser and type http://127.0.0.1/helloworld.asp in the URL box and hit enter. You will see an empty white page with Hello World written on top left. Well congratulations you just built your own first Active Server Page. If you see the code ( view -> source ( in your browser ) ) you will come to know that only the output Hello World! is there with the HTML tags and no <%, %>, Response.Write or Language ASP code is there . That is because ASP is a server side scripting language and all the code which we wrote is executed on the server and only the output generated is shown to the browser.
<% and %> tags
Our ASP script resides between the <% %> tags. Any script between the <% %> tags is executed on the server while the rest of the HTML tags or script in an .asp page is not parsed and is sent to the client browser as it is. There can be any number of <% %> tags as we want. After executing the code between the <% %> tags, the output which is generated is sent to the client and never ever the ASP code itself.
Understanding ASP Objects
As I stated earlier there are six built-in ASP Objects available to you as an ASP developer. But what is an object ? Well an object is an instance of a Component which has methods and properties. I am not going to indulge into what Components are except that they are a compiled piece of code built in any programming language which offer you the ability to just create an instance of them ( create an object ) and start using their methods. ASP is so much powerful that not only it uses these six built-in Objects but can also call other applications or components like ADO to access databases and CDO for messaging applications. You can even build your own custom COM components and then call their methods from within ASP. This is ASP COM integration which gives ASP is so much power that no other server side scripting language can match.
Six Built-in ASP Objects
Following are the six Objects which are available to you without needing to create an instance of them and that's why they are called built-in Objects :
ASPError Object is new and is available only in Windows 2000. By clicking the above ASP Objects you can see the collections, properties, events and methods which are made available by each of these.
To start using them following is the syntax you should use :
For example, recall that how we used Response.Write to output Hello World! to the client browser. In that case, Response was the name of the Object and Write was the name of the method that generated the output to the client browser.
<% Response.Write "Hello World!" %>
So you can use the methods and properties of the Objects by writing the Object name and then a dot and then appending the method or property name. Dot . is what separates the Object from the method or property. You must be wondering where have the opening and closing brackets ( ) gone in the Write method of Response Object, well in VBScript we don't type brackets in front of method name except in some cases. So that is why we just used Response.Write, that's why I say that VBScript is much more natural way of writing ASP pages and is the easiest of all languages.
Hay guys i think thats enough well u can atleast start with asp now so u r now a jack of trade of asp cool na
bye for now
Re: learn asp nice and easy
Nice Post Man...keep The Good Thing Comin Up...
Athlon 64 3500 @ 2.42 Ghz WITH Asus A8V Deluxe
Geforce 6800 Ultra & Audigy2
1GB Corsair PC3700XMS TwinX
2x74GB Raptors in raid 0
Sony Dual Layer DVD RW
Ultra X-Connect 500W PSU
MX1000 laser mouse, Transparent case & Lots of pretty lights
|Tags: asp, easy|
|Thread Tools||Search this Thread|
|Similar Threads for: "learn asp nice and easy"|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Which Programming Language is Easy to learn ?||Cool_Rahul||Polls & Voting||3||6 Days Ago 04:38 PM|
|Easy methodís to learn C programming?||Unnati!||Software Development||4||02-06-2011 11:41 AM|
|Which is easy to learn ASP Or PHP ?||Nadish||Software Development||3||26-03-2009 10:06 AM|