0

All i'm looking to do is create a page where the user enters text into various text boxes and then it is displayed below with other text. This is the code I have thus far, but i can't get it to work.

<%@ Page Language="C#" %>

<script runat="server">

    public void ctrlName_Change(object Sender, EventArgs E)
    {
    ctrlMessage.Text = "Hello " + ctrlName.Text;
    }

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>WebDev - Example</title>
    </head>
    <body>

    <form id="WebForm" runat="server">
        <p>WebDev - Example - A Simple Page</p>

        <p>Please enter your name:

        <asp:TextBox id="ctrlName"
                OnTextChanged="ctrlName_Change"
                runat="server" />
        <asp:Button id="ctrlSubmit" Text="Submit" runat="server" /></p>

        <p><asp:Label id="ctrlMessage" font-size="20pt" runat="server" /></p>
    </form>

    </body>
</html>

Edited by pyTony: fixed formatting

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ramy Mahrous
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.