【发布时间】:2015-10-10 20:01:25
【问题描述】:
当我点击锚标签时,页面得到回发并且什么都不做
代码如下图,
System.Web.UI.HtmlControls.HtmlAnchor anchor1 = new System.Web.UI.HtmlControls.HtmlAnchor();
anchor1.InnerText = "Edit";
anchor1.Attributes.Add("runat", "server");
anchor1.Attributes.Add("onServerClick", "anchor1_Click");
anchor1.Style.Add("color", "blue");
anchor1.Style.Add("float", "right");
protected void anchor1_Click(object sender, EventArgs e) {
ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('Enter Value For Drop Down Name');", true);
}
【问题讨论】: