i need some help with a task in my web programming course. were doing c# at the minute.
heres the task
Task 4
Build a forth page that contains a label, a text box and a button. When the page is loaded the Page title should be "Unit 4 Task 4". On button click the label is to display "Hello" followed by a space and whatever is input into the text box.
heres whats i have as the interface in task4.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="task4.aspx.cs" Inherits="HelloWorld.task4" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Your Name:<br />
<asp:TextBox ID="TBname" runat="server"></asp:TextBox>
<asp:Button ID="SayHello" runat="server" Text="Say Hi" />
<br />
<asp:Label ID="LBLhelloname" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
and heres what i got in task4.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HelloWorld
{
public partial class task4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SayHello_Click(object sender, EventArgs e)
{
LBLhelloname.Text = ("Hello" + TBname);
}
}
}
can anyone help me please