ASP.NET CS1061 向导中缺少定义错误
这是我在第 86 行上收到的错误
CS1061:“ASP.tabs_profile_vieweditprofile_aspx”不包含 “Wizard1_FinishButtonClick”的定义并且没有扩展方法 “Wizard1_FinishButtonClick”接受类型的第一个参数 可以找到“ASP.tabs_profile_vieweditprofile_aspx”(您是 缺少 using 指令或程序集引用?)
Line 84: </asp:Content>
Line 85: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
Line 86: <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="511px"
Line 87: StartNextButtonText="Edit Info" DisplaySideBar="False"
Line 88: FinishCompleteButtonText="Save"
并且我在 CS 类中确实有按钮的方法。有什么建议吗?!?
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
}
源代码。
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="511px"
StartNextButtonText="Edit Info" DisplaySideBar="False"
FinishCompleteButtonText="Save"
style="text-align: center; position: relative; top: 0px; left: 95px; width: 670px;"
onfinishbuttonclick="Wizard1_FinishButtonClick">
Here is the error I get on Line 86
CS1061: 'ASP.tabs_profile_vieweditprofile_aspx' does not contain a
definition for 'Wizard1_FinishButtonClick' and no extension method
'Wizard1_FinishButtonClick' accepting a first argument of type
'ASP.tabs_profile_vieweditprofile_aspx' could be found (are you
missing a using directive or an assembly reference?)
Line 84: </asp:Content>
Line 85: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
Line 86: <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="511px"
Line 87: StartNextButtonText="Edit Info" DisplaySideBar="False"
Line 88: FinishCompleteButtonText="Save"
And I do have the method for my button in the CS class. Any suggestions?!?
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
}
Source code.
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="511px"
StartNextButtonText="Edit Info" DisplaySideBar="False"
FinishCompleteButtonText="Save"
style="text-align: center; position: relative; top: 0px; left: 95px; width: 670px;"
onfinishbuttonclick="Wizard1_FinishButtonClick">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 .ascx 和 .ascx.cs 命名空间将不匹配 - 这是一个常见的错误。确保您的 Inherits 命名空间与 .cs 文件中的命名空间匹配。这可能就是这里的问题。
Your .ascx and .ascx.cs Namespaces won't be matching - it's a popular error. Make sure your Inherits namespace matches the one in the .cs file. That'll likely be the issue here.