62,074
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="lbl" runat="server"></asp:Label>
<br />
<asp:Literal ID="lit" runat="server"></asp:Literal>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
string html = "";
for (int i = 1; i < 5; i++)
{
html += string.Format("<img id='img{0}' onclick={1} /> ", i, ClientScript.GetPostBackEventReference(this, "img" + i.ToString()));
}
lit.Text = html;
}
#region IPostBackEventHandler Members
void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
lbl.Text = "Postback handled by " + this.ID + ". <br/> Postback caused by " + eventArgument + ".";
//throw new NotImplementedException();
}
#endregion