ASP.NET HTML 控件 Checkbox

asp.net html 控件 checkbox

<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>
<html>
<body>

<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>

</body>
</html>
相关文章