ASP ModalPopupControl +向导:缺少程序集或参考?

发布于 2024-10-30 04:31:16 字数 1728 浏览 0 评论 0原文

我在网上查找了与我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白色秋天 2024-11-06 04:31:16

您的 CodeBehind 事件处理程序应如下所示 (VB):

Protected Sub Wizard_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard.FinishButtonClick

并且 Wizard 控件不是 AJAX 控件工具包的一部分,您应该能够在没有它的情况下测试它。

your CodeBehind even handler should look like (VB):

Protected Sub Wizard_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard.FinishButtonClick

And the Wizard control is not part to the AJAX Control ToolKit, you should be able to test it without it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文