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>
結(jié)果:
相關(guān)文章
- ASP.NET Web Pages Email
- ASP.NET Web Pages WebSecurity 參考手冊(cè)
- ASP.NET MVC 控制器
- ASP.NET MVC – 發(fā)布
- ASP.NET ViewState
- WebSecurity RequireAuthenticatedUser 方法
- WebSecurity RequireRoles 方法
- ASP.NET HTML 控件 RequiredFieldValidator
- C# 實(shí)例 For Each 循環(huán)
- C# 實(shí)例 使用 Chart 幫助器 根據(jù) XML 文件顯示餅圖
- ASP.NET Calendar CellSpacing 屬性
- ASP.NET Calendar SelectedDate 屬性
- ASP.NET Calendar SelectWeekText 屬性
- ASP.NET BorderStyle 屬性
- ASP.NET CalendarDay IsSelected 屬性
- ASP.NET Button UseSubmitBehavior 屬性
- ASP.NET DropDownList SelectedIndex 屬性
- ASP.NET HyperLink ImageUrl 屬性
- htmlinputimage
- htmltable 2