<script runat="server" language="C#">
void Page_Load()
{
Message1.Text = "";
Message2.Text = "";
Message3.Text = "";
if (text1.Text != "") {
Message1.Text = "You have entered the following name: " + text1.Text;
}
if (text2.Text != "") {
Message2.Text = "You have entered the following address: " + text2.Text;
}
if (text3.Text != "") {
Message3.Text = "You have entered the following password: " + text3.Text;
}
}
</script>
<html>
<head>
<title>Text Box Example</title>
</head>
<body>
<asp:label id="Message1" runat="server" />
<br />
<asp:label id="Message2" runat="server" />
<br />
<asp:label id="Message3" runat="server" />
<br />
<form runat="server">
Please enter your name:
<asp:textbox id="text1" runat="server" />
<br /><br />
Please enter your address:
<asp:textbox id="text2" runat="server" rows=5 textmode="multiline" />
<br /><br />
Please enter your chosen password:
<asp:textbox id="text3" runat="server" textmode="password" />
<br /><br />
<input type="Submit">
</form>
</body>
</html>
|