ASP ModalPopupControl +向导:缺少程序集或参考?
我在网上查找了与我使用 ASP Web 表单时遇到的编译错误有关的答案,该表单使用了一些使用 AJAX Control ToolKit 控件的控件。
所以我
<form>
<asp:ToolkitScriptManager></asp:ToolkitScriptManager>
<div id="mainContent">
<asp:Button ID="booking" runat="server" Text="Add New Booking" />
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="booking" PopupControlID="Panel1" Drag="true" >
</asp:ModalPopupExtender>
<div id="Panel1" style="display: none;" class="modalPopup">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Wizard ID="wizard" runat="server" ActiveStepIndex="0" BackColor="#E6E2D8"
</asp:Wizard>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
在 web.config 中放入了 AjaxControlToolkit 所需的行:
<pages>
<controls>
<add tagPrefix="asp"
namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" />
</controls>
</pages>
问题是当我为 wizard_finishButtonClicked
添加一个偶数向导时(此事件的 CodeBehind 是 ModalPopupExtender1.Hide();
),以便我可以在单击向导中的完成按钮时隐藏弹出窗口。但我收到编译错误:
CS1061: 'ASP.test_aspx' does not contain a definition for 'wizard_FinishButtonClick'
and no extension method 'wizard_FinishButtonClick' accepting a first argument of
type 'ASP.test_aspx' could be found (are you missing a using directive or an assembly
reference?)
我做错了什么?有人可以给我提示吗?
I've looked around the web to find the answer to do with Compilation error I'm getting with a ASP web Form I have which makes use of afew using AJAX Control ToolKit controls.
So I have
<form>
<asp:ToolkitScriptManager></asp:ToolkitScriptManager>
<div id="mainContent">
<asp:Button ID="booking" runat="server" Text="Add New Booking" />
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="booking" PopupControlID="Panel1" Drag="true" >
</asp:ModalPopupExtender>
<div id="Panel1" style="display: none;" class="modalPopup">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Wizard ID="wizard" runat="server" ActiveStepIndex="0" BackColor="#E6E2D8"
</asp:Wizard>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
I have in web.config put in the required lines for AjaxControlToolkit :
<pages>
<controls>
<add tagPrefix="asp"
namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" />
</controls>
</pages>
Problem is when I add an even to wizard for wizard_finishButtonClicked
(CodeBehind for this event is ModalPopupExtender1.Hide();
) so that I can hide the popup when the finish button in wizard is clicked. But I get compilation error saying:
CS1061: 'ASP.test_aspx' does not contain a definition for 'wizard_FinishButtonClick'
and no extension method 'wizard_FinishButtonClick' accepting a first argument of
type 'ASP.test_aspx' could be found (are you missing a using directive or an assembly
reference?)
What am I doing wrong? Can someone give me a hint?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 CodeBehind 事件处理程序应如下所示 (VB):
并且 Wizard 控件不是 AJAX 控件工具包的一部分,您应该能够在没有它的情况下测试它。
your CodeBehind even handler should look like (VB):
And the Wizard control is not part to the AJAX Control ToolKit, you should be able to test it without it.