test4-4webform1.aspx
  •  
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test4_4.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="~/image/banner.jpg"> <asp:RectangleHotSpot Bottom="26" NavigateUrl="http://www.baidu.com" Right="69"/> <asp:RectangleHotSpot Bottom="26" Left="71" Right="141" NavigateUrl="http://www.163.com" /> <asp:RectangleHotSpot Bottom="26" Left="142" Right="212" NavigateUrl="http://www.sogou.com" /> <asp:RectangleHotSpot Bottom="26" Left="213" Right="283" NavigateUrl="http://www.taobao.com" /> <asp:RectangleHotSpot Bottom="26" Left="285" Right="355" NavigateUrl="http://www.sina.com" /> <asp:RectangleHotSpot Bottom="26" Left="357" Right="428" NavigateUrl="http://www.qq.com" /> </asp:ImageMap> </div> </form></body></html>
test4-5webform1.aspx
  •  
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test4_5.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <form id="form1" runat="server"> <div> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"> <asp:ListItem Value="0">A 1+1=2</asp:ListItem> <asp:ListItem Value="1">B 1+1=3</asp:ListItem> <asp:ListItem Value="2">C 1+1=4</asp:ListItem> <asp:ListItem Value="3">D 1+1=1</asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label> </div> </form></body></html>
webform1.aspx.cs
  •  
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;
namespace test4_5{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e){ Label1.Visible = true; if (int.Parse(RadioButtonList1.SelectedValue) == 0) { Label1.Text = "选择正确"; } else { Label1.Text = "选择错误"; } } }}
test4-6webform1.aspx
  •  
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test4_6.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <form id="form1" runat="server"> <div> 付款地址:<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="45px" Width="199px"></asp:TextBox> <br /> 发货地址:<asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Height="45px" Width="199px"></asp:TextBox> <br /><br /> <asp:CheckBox ID="CheckBox1" runat="server" Text="发货地址与付款地址相同" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /> </div> </form></body></html>
webform1.aspx.cs
  •  
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;
namespace test4_6{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e){
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e){ if (CheckBox1.Checked) { TextBox2.Text = TextBox1.Text; } else { TextBox2.Text = ""; } } }}

asp.net 4.5入门基础(003)_html