2016-03-29 9 views
2

Ajaxツールキットはマスターページを使用していませんが、マスターページを使用せずに完全に動作します。私はまだ解決策を見つけることができないので、これを試しています。VS 2013を使用してAjaxツールキットが動作しない

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 

私は、マスターページにスクリプトマネージャ追加しました:

以下は、マスターページのHTMLコードです。

<asp:ScriptManager ID="ScriptManager1" runat="server"> 
     <Scripts> 

      <asp:ScriptReference Name="MsAjaxBundle" /> 
      <asp:ScriptReference Name="jquery" /> 
      <asp:ScriptReference Name="bootstrap" /> 
      <asp:ScriptReference Name="respond" /> 
      <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" /> 
      <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" /> 
      <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" /> 
      <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" /> 
      <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" /> 
      <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" /> 
      <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" /> 
      <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" /> 
      <asp:ScriptReference Name="WebFormsBundle" /> 

     </Scripts> 
    </asp:ScriptManager> 

コンテンツページのhtmlコード:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 

は、コンテンツページにスクリプトを追加しました:

<asp:ScriptManagerProxy runat="server" /> 

私は、下記のカレンダーエクステンダー用toolkitmangerを使用していますhtmlのデザインです:

<asp:TextBox ID="txt_Dispdate" runat="server" Style="width: 50%" CssClass="form-control" AutoPostBack="True" OnTextChanged="txt_Dispdate_TextChanged" 
            ></asp:TextBox> 

<cc1:calendarextender ID="CalendarExtender1" runat="server" TargetControlID="txt_Dispdate" 
           OnClientDateSelectionChanged="CheckForPastDate" Enabled="True" Format="MM/dd/yyyy"></cc1:calendarextender> 

Web.configコントロールアセンブリコード:

 <compilation debug="true" targetFramework="4.5.1"> 
    <assemblies> 
    <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
    </assemblies> 

<controls> 
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> 
    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> 

    </controls> 

テキストボックスをクリックすると何も表示されません。私はまた以下の例を試した。 https://timscyclingblog.wordpress.com/2013/03/22/ajaxcontroltoolkit-version-7-0123-with-net-4-5/

ありがとうございました。

答えて

1

私は答えを得ました、私はCheckForPastDate JavaScript関数をマスターページに入れるのを忘れていました。カレンダーが表示されない理由です

ありがとうございます

関連する問題