简单教程
提交运行
代码编辑器:
<script runat="server"> Sub Check(sender As Object, e As EventArgs) if check1.Checked then work.Text=home.Text else work.Text="" end if End Sub </script> <!DOCTYPE html> <meta charset="utf-8" /> <form runat="server"> <p>Home Phone: <asp:TextBox id="home" runat="server" /> <br> Work Phone: <asp:TextBox id="work" runat="server" /> <asp:CheckBox id="check1" Text="Same as home phone" TextAlign="Right" AutoPostBack="True" OnCheckedChanged="Check" runat="server" /> </p> </form>
运行结果: