问题:calender.gif没有显示,所以我无法获得日历功能。
尝试:我有jQuery日历正在处理另一个项目,并且有点难过为什么它现在不工作。
我已确保图像实际位于jquery文件夹中以修复任何文件夹问题,检查图像是否存在以及内容占位符与ctl00_body_lblDateEnd
部分的源视图是否正确。
我也试过去掉'#'和'ct100_body _'
CSS和jQuery链接看起来都是正确的而不是来自控制台的错误,我也通过拖入来重新检查它们。
我遗失的任何东西......?一个#
或'
某个地方?!
我在vb.net端有一个隐藏的和一个unhidden用于测试。
代码:
jquery的
// Variables passed out here from the functions as we can not check inputs
var lblDateStart = '<%= lblDateStart.ClientId %>';
function setLabelStart(yourDate1) {
$("ctl00_Body_lblDateStart").val(yourDate1);
}
var lblDateEnd = '<%= lblDateEnd.ClientId %>';
function setLabelEnd(yourDate2) {
$("#ctl00_body_lblDateEnd").val(yourDate2);
}
$(document).ready(function () {
$("#datepickerFrom").datepicker({
//display month drop down
changeMonth: true,
//display year drop down
changeYear: true,
//date format
dateFormat: "dd/mm/yy",
//calender image
showOn: "button",
buttonImage: "calendar.gif",
buttonImageOnly: true,
//multiple months
numberOfMonths: 2,
//show 'done' button
//showButtonPanel: true,
// Default Date
defaultDate: "-4w",
//pass value to variable
onSelect: setLabelStart
});
});
//More than one date? You need to scripts
$(document).ready(function () {
$("#datepickerTo").datepicker({
//display month drop down
changeMonth: true,
//display year drop down
changeYear: true,
//date format
dateFormat: "dd/mm/yy",
//calender image
showOn: "button",
buttonImage: "calendar.gif",
buttonImageOnly: true,
//multiple months
numberOfMonths: 2,
//show 'done' button
//showButtonPanel: true,
// Default Date
defaultDate: "+0w",
//pass value to variable
onSelect: setLabelEnd
});
});
主页.aspx &LT;
%@ Page Title="" Language="VB" MasterPageFile="~/gateway/MasterPageTEST.master" AutoEventWireup="false" CodeFile="holiday.aspx.vb" Inherits="Holiday" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Header" Runat="Server">
<!-- // Disable enter key due to multiple submit buttons!! \\ -->
<script type="text/javascript">
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type == "text")) { return false; }
}
document.onkeypress = stopRKey;
</script>
<!-- Calender Functions -->
<link href="../../css/Calender.css" rel="stylesheet" type="text/css" />
<script src="../../jQuery/CalenderFunctionality.js" type="text/javascript"></script>
<script src="../../jQuery/jquery-1.9.1.js" type="text/javascript"></script>
<script src="../../jQuery/jquery-ui.js" type="text/javascript"></script>
<!--//Resize the calender here -->
<style type="text/css">
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 0.8em; background: #blue}
</style>
<!-- // calender functions -->
<!-- \\ Disable enter key due to multiple submit buttons!! // -->
<!-- ######################### //BODY CODE UNIQUE TO PAGE \\ ######################### -->
<!-- ######################### //HEADER CODE UNIQUE TO PAGE \\ ######################### -->
<!-- ######################### \\HEADER CODE UNIQUE TO PAGE // ######################### -->
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="LeftBarImage" Runat="Server">
<!-- ######################### //Left hand banner image \\ ######################### -->
<img src="/gateway/photos/gateway_3.jpg" alt="Page Preview" />
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="LeftBarNotes" Runat="Server">
<div id="Points_box">
<h3>Quick Notes</h3>
<div id="Side1" class="SmallBar">
</div> <!-- Side1 -->
<span id="Gold1" class="Gold">
</span><!-- Gold -->
<div id="Pad20B" class="Pad20">
</div> <!-- Pad20B -->
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GWmyPemcoSQL %>"
SelectCommand="SELECT * FROM [tblHolidayRequests] WHERE ([EmployeeID] = @EmployeeID) order by ID desc;" >
<SelectParameters>
<asp:SessionParameter DefaultValue="xyz999" Name="EmployeeID" SessionField="EmployeeID"
Type="string" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Panel ID="PanelMain" runat="server" Visible="true">
<div id="WrapperBlock" class="WrapperBlock">
<div id="Block1" class="Block1">
<h3>
Book a Holiday </h3>
</div> <!-- Block1 -->
<div id="Block2" class="Block2">
<%-- <asp:Button ID="btnPDTR" runat="server" CssClass="btnFloatRight" Text="View Your PDTR" />--%>
</div><!-- Block2 -->
</div><!-- WrapperBlock -->
<p>Please ensure you are leaving at least 25 days between your holidays start date and today</p>
<form>
<p>Please select the dates you wish to book a holiday for below</p>
<table>
<tr>
<td style="width: 217px">Date from (DD/MM/YYYY)</td>
<td><asp:TextBox ID="lblDateStart" runat="server" width="150px" Text="01/06/2013" /><input id="datepickerFrom" /></td>
<td style="width: 217px">Date to (DD/MM/YYYY)</td>
<td><asp:TextBox ID="lblDateEnd" runat="server" width="150px" Text="01/06/2014" /><input type="hidden" id="datepickerTo" /></td>
</tr>
</table>
</form>
<p></p>
<p>Please number of working days this includes</p>
<asp:DropDownList ID="ddHolidayDays" runat="server">
<asp:ListItem Value="99">Please Select</asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5">5</asp:ListItem>
<asp:ListItem Value="6">6</asp:ListItem>
<asp:ListItem Value="7">7</asp:ListItem>
<asp:ListItem Value="8">8</asp:ListItem>
<asp:ListItem Value="9">9</asp:ListItem>
<asp:ListItem Value="10">10</asp:ListItem>
<asp:ListItem Value="11">11</asp:ListItem>
<asp:ListItem Value="12">12</asp:ListItem>
<asp:ListItem Value="13">13</asp:ListItem>
<asp:ListItem Value="14">14</asp:ListItem>
<asp:ListItem Value="15">15</asp:ListItem>
<asp:ListItem Value="16">16</asp:ListItem>
<asp:ListItem Value="17">17</asp:ListItem>
<asp:ListItem Value="18">18</asp:ListItem>
<asp:ListItem Value="19">19</asp:ListItem>
<asp:ListItem Value="20">20</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="lblErrorWorkingDays" runat="server" Text="" visible="false" ForeColor="Red"/>
<p></p>
<asp:Button ID="btnRest" runat="server" Text="Reset" CssClass="btnReset" />
<asp:Button ID="btnSubmit" runat="server" CssClass="btnSubmit" />
<p></p><p></p><p></p><p></p><p></p><p></p>
Previous Holiday Requests
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
EmptyDataText="There are no data records to display." Width="770px"
Font-Size="Medium" AutoGenerateColumns="False" CssClass="mGrid"
PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField HeaderText="Holiday Start Date" SortExpression="DateStart">
<ItemTemplate>
<asp:Label ID="DateStart" runat="server" Width="70px" Text='<%# DateTidy(Eval("DateStart")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Holiday End Date" SortExpression="DateEnd">
<ItemTemplate>
<asp:Label ID="DateEnd" runat="server" Width="70px" Text='<%# DateTidy(Eval("DateEnd")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="WorkingDays" HeaderText="Working Days Used" SortExpression="WorkingDays" />
<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
</Columns>
</asp:GridView>
</asp:Panel>
<asp:Panel ID="PanelThankYou" runat="server" Visible="false">
<div class="PageWrapper" >
<h2> Thank You</h2> <br />
<br />
<asp:Label ID="lblThankYou" runat="server" Text="Label" />
<br />
<asp:Button ID="btnResetThanks" runat="server" Text="Click Here to request another holiday" CssClass="btnReset" />
</div> <!-- PageWrapper -->
</asp:Panel>
<!-- ######################### \\BODY CODE UNIQUE TO PAGE // ######################### -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer" Runat="Server">
<!-- ######################### //FOOTER CODE UNIQUE TO PAGE \\ ######################### -->
<p></p>
<!-- ######################### \\FOOTER CODE UNIQUE TO PAGE // ######################### -->
</asp:Content>
<asp:Content ID="Content4" runat="server" contentplaceholderid="SubTitle">
<!-- '################################################################### -->
<!-- '################################################################### -->
<!-- '################################################################### -->
<!-- '################################################################### -->
<div id="MainTitleWrapper">
<div id="MainTitleBar1" class="MainTitleBar">
</div> <!-- MainTitleBar1 -->
<div id="MainTitleContent">
<h1><img src="/gateway/images/gateway/Writing.png" alt="Writing Icon" />Request a Holiday Booking</h1>
</div> <!-- MainTitleContent -->
<div id="MainTitleBar2" class="MainTitleBar">
</div> <!-- MainTitleBar2 -->
<!-- '################################################################### -->
<!-- '################################################################### -->
<!-- '################################################################### -->
<!-- '################################################################### -->
</div>
</asp:Content>