View Single Post
  #1 (permalink)  
Old 06-24-2007, 12:26 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon13 ASP.NET Starter Kit

Hello, I'm back with my tutorial series!!! hopefully you guys are a little bit excited because I want to share a little bit of my experience.. Please let me know if there's any correction that I have to make in this tutorial, and feel free to give some additional comments if you have better way to solve some problems

First of all, before starting to program ASP.NET, you need to make sure that you have at least the first and second component below: (third component is recommended)
1. IIS (Internet Information Services) - If you're using Windows XP, you can follow the step below:
Control Panel --> Add/Remove Program --> Add/Remove Windows Components --> Check the IIS (Internet Information Services)

Note that at this point you will need your genuine Windows XP SP2 CD to install this component to your windows operating system.

IIS will let you run your .asp .aspx file locally.

2. .NET Framework 2.0 here:

Download details: .NET Framework 2.0 Software Development Kit (SDK) (x86) - UPDATED LINK!
You need to download and install this component in order to test .asp and .aspx on your local machine

3. I'm currently using Mirosoft Visual Studio 2005 Professional. There's other IDE such as Dreamweaver. You can get the Visual Web Developer Express Edition for free here:

Visual Studio Express: Visual Web Developer - Easy to Use

Note that you can write codes by using Visual Basic or C#. In this tutorial, I'll be using C#. Why? Because it's my preference, some people found that VB is better than C# haha...

Let's now write codes:

Default.aspx
PHP Code:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
    <
title>My First ASP.NET Web Page</title>
</
head>
<
body>
    <
form id="shoutForm" runat="server">
    <
div>
        <
asp:TextBox ID="name" runat="server" Width="296px"></asp:TextBox>
        <
asp:Button ID="shoutBtn" OnClick="submit" runat="server" Text="SHOUT NOW!" /></div>
        <
p><asp:Label ID="shoutName" runat="server"></asp:Label></p>
    </
form>
</
body>
</
html
Default.aspx.cs
PHP Code:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default System.Web.UI.Page 
{
    
protected void Page_Load(object senderEventArgs e)
    {
        
shoutName.Text "HI EVERYBODY! MY NAME IS " name.Text;
    }

Try out the program, and see if it works? Explanation of this program is fairly simple. Whatever is in my Default.aspx will be sent to the server Default.aspx.cs and processed there to create another input, which is your name

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by HelloWorld : 06-25-2007 at 12:58 AM.
Reply With Quote