<html>
<script language="VB" runat="server">
Sub EnterBtn_Click(Sender As Object, E As EventArgs)
Message.Text = "Hi " & Name.Text & ", welcome to ASP.NET!"
End Sub
</script>
<body>
<h3><font face="Verdana">Handling Control Action Events</font></h3>
<p>
This sample demonstrates how to access a <asp:textbox> server control within the "Click"
event of a <asp:button>, and use its content to modify the text of a <asp:label>.
<p>
<hr>
<form action="controls3_vb.aspx" runat=server>
<font face="Verdana">
Please enter your name: <asp:textbox id="Name" runat=server/>
<asp:button text="Enter" Onclick="EnterBtn_Click" runat=server/>
<p>
<asp:label id="Message" runat=server/>
</font>
</form>
</body>
</html>
|