2014-02-21 68 views
0

我有一個應用程序MVC 4,其中不幸的是我需要把一些ASPX Web表單才能使用ReportViewerControl ...整合內部網頁表單的jQuery使用母版頁

我的問題是 試圖用一個母版對於這些aspx web表單,jquery停止了工作。

這是母版代碼

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterAspx.master.cs" Inherits="GestioneMovimentazioni.MasterAspx" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <link href="Content/Site.css" rel="stylesheet" type="text/css" /> 
    <script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script> 
    <script src="Scripts/jquery-ui-1.10.3.custom.js" type="text/javascript"></script> 
    <link href="Content/themes/red_green_white/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" /> 
    <script src="Scripts/jquery.ui.datepicker-it.js"></script> 


    <asp:ContentPlaceHolder ID="head" runat="server"> 
    </asp:ContentPlaceHolder> 

</head> 

<body> 

    <form id="form1" runat="server"> 
    <div> 
     <div id="div_header" class="div_header"> 
      <div class="float-left"> 
       <img src="~/Images/img_sx_r.png" /> 
      </div> 
      <div id="page_title" class="float-left div_header_page_title" > 

      </div> 
      <div class="float-right"> 
       <img src="~/Images/img_dx_r.png" /> 
      </div> 
     </div> 
     <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" > 

     </asp:ContentPlaceHolder> 
    </div> 
    </form> 
</body> 
</html> 

這是形式

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAspx.Master" AutoEventWireup="true" CodeBehind="BilCom.aspx.cs" Inherits="GestioneMovimentazioni.BilCom" %> 

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> 



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 

    <script type="text/javascript"> 
     $(document).ready(function() { 

      $('#txtDate').datepicker({ 
       changeMonth: true, 
       changeYear: true, 
       showButtonPanel: true, 
       dateFormat: 'MM yy', 
       onClose: function (dateText, inst) { 
        var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); 
        var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); 
        $(this).datepicker('setDate', new Date(year, month, 1)); 
       } 
      }); 


     }); 
    </script> 
    <style> 
     .ui-datepicker-calendar { 
      display: none; 
     } 
    </style> 


</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> 


     <div class="div_display_table"> 
      <div class="div_display_table_row"> 
       <div class="div_display_table_cell"> 
        <label id="label_data_filter">Mese</label> 
       </div> 

       <div class="div_display_table_cell"> 
        <label id="label1">Calcola</label> 
       </div> 
      </div> 


      <div class="div_display_table_row"> 
       <div class="div_display_table_cell"> 
        <asp:TextBox ID="txtDate" runat="server" class="input_add w_80"></asp:TextBox> 

       </div> 
            <div class="div_display_table_cell"> 
        <asp:ImageButton ID="btnCalcola" runat="server" ImageUrl="~/Images/calcola.png" /> 
       </div> 
      </div> 
     </div> 

     <div> 

       <asp:ScriptManager ID="ScriptManager2" runat="server" /> 

      <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="900px" Height="650px" 
       Font-Names="Calibri" Font-Size="8pt" WaitMessageFont-Names="Calibri" 
       WaitMessageFont-Size="14pt"> 

      </rsweb:ReportViewer> 
     </div> 

</asp:Content> 

你能幫助我理解爲什麼日期選擇器已停止工作? 謝謝!

+0

Q1〜jQuery的停止工作或日期選擇器停止工作,併成功jQuery的負荷? Q2-爲什麼你有'.ui-datepicker-calendar {display:none;}'? – Arbel

+0

「停止工作」是指什麼? – Andrei

+0

謝謝Q1 - jquery停止工作,Q2 - 僅顯示月份和星期而不顯示日期 - – user2743368

回答

1

你需要設置屬性的ASP文本框的「的ClientIDMode」到「靜態