我在后面的代码中有以下代码,用于附加到简单按钮单击事件的用户控件。如何避免这种情况导致无效的回发?它会生成事件验证错误。
protected void EditButton_Click(object sender, EventArgs e)
{
PopulateEditControls();
pnlEditDialog.Visible = true;
Page.ClientScript.RegisterStartupScript(
this.GetType(),
"navigate",
"window.onload = function()
{window.location.hash='#editDialog';}",
true);
}