The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > ASP / ASP.NET


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: , , , , ,

Reply
 
LinkBack Thread Tools    Display Modes   
  #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,119
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
  #2 (permalink)  
Old 06-24-2007, 12:39 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,119
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
I got this error message when I try to compile the program:

Code:
Error	1	'ASP.default_aspx' does not contain a definition for 'submit'
does anybody have ideas?

__________________

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!
Reply With Quote
  #3 (permalink)  
Old 07-09-2007, 08:12 PM
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,119
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon11

Sorry for the confusions of this thread, this one will surely work!

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>ASP.NET Web Test Form</title>
</
head>
<
body>
    <
form id="shoutForm" runat="server">
    <
div>
        <
asp:TextBox ID="name" runat="server"></asp:TextBox>
        <
asp:Button ID="submit" runat="server" OnClick="BtnOnClick" Text="SHOUT!" />
        <
p>
            <
asp:Label ID="result" runat="server"></asp:Label>
        </
p>
    </
div>
    </
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 BtnOnClick(object senderEventArgs e)
    {
        
String value name.Text;
        
result.Text "HELLO! MY NAME IS " value;
    }

hopefully the code itself is self explanatory... if not, then ask questions... I'm not an expert at this, but I'm also learning ASP.NET

__________________

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!
Reply With Quote
  #4 (permalink)  
Old 07-10-2007, 08:21 AM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 317
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
thanks for the tutorial... best of luck on your asp.net adventure
Reply With Quote
  #5 (permalink)  
Old 07-10-2007, 09:25 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,119
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by ccoonen View Post
thanks for the tutorial... best of luck on your asp.net adventure
Thanx
I probably will need your help in the future. But do you strictly only use VB instead of C#? You said last time that you could also do it in C# right..? For me, VB is just not really working for some reason, probably later once I'm done learning it with C#, then try it out with VB

__________________

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!
Reply With Quote
Reply


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 10:18 AM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50