Author Topic: Code help  (Read 958 times)

Offline robin1989

  • Site Owner - Site Maintenance & development
  • Administrator
  • Mad Bomber
  • *
  • Posts: 6272
  • Post quality +21/-0
  • Gender: Male
  • Site owner
    • Acidmods
Code help
« on: October 21, 2008, 03:42:05 AM »
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
Code: [Select]
<%@ 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
Code: [Select]
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

i am not responsible for what i do or my advice


Get the iPhone 4s from Three using Quidco and recieve £109 cashback

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal