网页在第一次运行时,它动态产生了一个铵钮,此称为第一个铵钮,当用户用mouse点击这个铵钮时,会动态产生另一个铵钮,此称为第二个铵钮,当用户再用mouse点击第二个铵钮时,系统将处理另外的事情。此博文是实再第二个铵钮的Click事件。首先看看效果:
.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>网页运行时动态产生的Button</legend>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</fieldset>
<fieldset>
<legend>用Mouse点击第一个Button产生的Button</legend>
<asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>网页运行时动态产生的Button</legend>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</fieldset>
<fieldset>
<legend>用Mouse点击第一个Button产生的Button</legend>
<asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>