kshahnazari 0 Newbie Poster

hi i have a big problem with this program . it should work because it works in a CD lesson but now it doesn't . then i tried this program and this doesn't work either .
it should do this : in the name box a person should enter a word . then another text boxes value and the text that the result is here should become as the value as the first text box . i putted an example of asd in the first text box . please help me .
the source:

<%@ 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></title>
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
            width: 78px;
        }
    </style>
    <script language="javascript" type="text/javascript">
// <![CDATA[

        function Button1_onclick() {

        }

// ]]>
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
    <table style="width:100%;">
        <tr>
            <td class="style2">
                name</td>
            <td>
                <input id="Text1" type="text" runat="server" value="asd" /></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                age</td>
            <td>
                <input id="Text2" type="text" runat="server" /></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1" colspan="3">
            <label id="resultlabel" runat="server">the result is here</label>
                &nbsp;</td>
        </tr>
    </table>
    <p>
        <input id="Submit1" type="submit" value="submit" runat="server"  onserverclick="Dothis" /></p>
</body>
</html>

the program :
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Dothis(object sender, EventArgs args)
{
string a;
a = Text1.Value;
Text2.Value = a;
resultlabel.InnerText = a;
}
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.