View Single Post
  #1 (permalink)  
Old 06-29-2007, 12:40 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,122
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon9 Help with ASP.NET C# Form

This is the .aspx code that I currently have:

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>Untitled Page</title>
</
head>
<
body>
   <
form id="Form1" runat="server">
      
What is your name?<br />
      <
asp:Textbox ID="Textbox1" Runat="server"></asp:Textbox><br />
      <
asp:Button ID="Button1" Runat="server" Text="Submit"
       
OnClick="Button1_Click" />
      <
p><asp:Label ID="Label1" Runat="server"></asp:Label></p>
   </
form>
</
body>
</
html
This one is the 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 Button1_Click(object senderEventArgs e)
    {
        
Label1.Text "Hello " Textbox1.Text;
    }

I don't see if there's anything wrong on my codes, but the result is not as waht I expected to be. The form loads as expected, but when I type in input value to the textbox, it doesn't return me anything ;-/ It basically just stays on the same page, and showing the same thing.... thx for the help... appreciate it!!!

__________________

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