0
ASPX:按钮无法找到事件处理
<asp:ImageButton ID="imgBtnPrintCA" onclick="btnPrintCA_Click" runat="server"
ImageUrl="~/Content/Image/print_32.gif" />
代码背后:
protected void btnPrintCA_Click(object sender, ImageClickEventArgs e)
{
try
{
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "_Page",
"showPVDialog('ContentAssignmentPrint.aspx','')", true);
}
catch
{
}
}
错误: '在大写 '的onclick
does not contain a definition for 'Button' and no extension method 'btnPrintCA_Click' accepting a first argument
打开设计器页面并检查事件是否已注册? –
此代码有效,它必须是一个underlay /不同的问题。也许你正在静态地使用Button类,在“Button”后面搜索你的代码。 –