- slide 1 of 4
ASP for beginners is a great way to learn a simple and elegant language, and a great way to build or improve your website. This tutorial will take you through all of the basic steps to get you started with ASP.net in a simple and easy to follow way. There are a couple of things you may want to know about ASP for beginners before we get started. ASP.net is a language developed by Microsoft. ASP stands for Active Server Pages. To start, you need a tool to create your website with. This tool is Visual Studio Express. After clicking the free download link above and going through the installation process, you will now be ready to start building your site.
- slide 2 of 4
Why Hello World
Your first webpage will be a simple project that displays Hello World. Once you have Visual Studio running, go to file and click start a new website. On the bottom of the box that pops up, change the language from Visual Basic to Visual C#. You should be looking at the default page now. You can put whatever text you'd like in between the two div tags. Once you have the text you want to display, hit ctrl + f5. This will open up a browser displaying your web page. Another way to achieve the same effect is to go to Debug, then click start without debugging.
- slide 3 of 4
So far, you know how to make your web page and view it; but since this is ASP for beginners, let's actually write some ASP.net code. In the same place you put your Hello World you can make a label. Just insert the following: <asp:Label ID="Hello" Text="Hello World" runat="server"></asp:Label> Now if you run it you will get the same Hello World display as before. A label is just a simple asp web control used to display text. The ID and runat="server" is common to many ASP.net controls. Each controls needs a unique ID which can be anything you want. However, it needs the runat="server" bit as well. All of this basically means that you can manipulate the control in your code by using its ID.
- slide 4 of 4
The Code Behind
You may have noticed in your solution explorer that there is a file attached to your webpage. That is a spot where you can put your support code for the webpage. ASP.net code is only one half of the website, referred to as the front-end. The front-end is what the user interacts with. With ASP.net you can make neat interactive textboxes, checkboxes, and drop down lists. However, you need something to actually manipulate those in the back-end. In Visual Studio you have two options: either use Visual C# or Visual Basic. Personally when creating a webpage, I recommend that you use Visual C# and unselect the box that says put code in separate file. While this is supposedly ASP for beginners, it will not take you long to go from beginner to very knowledgeable. I wish you the best of luck in creating your new website.