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

时间:2011-04-05 05:07:36

标签: asp.net ajaxcontroltoolkit

我已经浏览了网页,找到了编译错误的答案,我正在使用ASP网页表单获取,它使用了afew,使用了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?)

我做错了什么?有人能给我一个暗示吗?

1 个答案:

答案 0 :(得分:0)

你的Code Behind事件处理程序应该看起来像(VB):

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

并且Wizard控件不是AJAXControlToolKit的一部分,你应该能够在没有它的情况下进行测试。