none
JQuery-Datepicker RRS feed

  • Question

  • I'm using a datepicker for my dynamic website. But I get the following errors:

    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\website51\b9cb3f1e\d1676cd6\App_Web_4rtyod4l.28.cs(533,17): error CS1002: ; expected
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\website51\b9cb3f1e\d1676cd6\App_Web_4rtyod4l.28.cs(533,17): error CS1525: Invalid expression term '.'
    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\website51\b9cb3f1e\d1676cd6\App_Web_4rtyod4l.28.cs(533,18): error CS1002: ; expected
    Validation Complete

    My code:

    This is my code for "DateTime_Edit.ascx.cs" 
    
    <%@ Control Language="C#" CodeFile="DateTime_Edit.ascx.cs" Inherits="DateTime_EditField" %>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%TextBox1.ClientID %>').datepicker();
        });
    </script>
    <asp:TextBox ID="TextBox1" runat="server" CssClass="DDTextBox" Text='<%# FieldValueEditString %>' Columns="20"></asp:TextBox>
    
    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" Enabled="false" />
    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" Enabled="false" />
    <asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" />
    <asp:CustomValidator runat="server" ID="DateValidator" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" EnableClientScript="false" Enabled="false" OnServerValidate="DateValidator_ServerValidate" />
    
    And this is where I added Jquery in my masterpage(Here you can find the head section):
    <head runat="server">
        <title>Dynamic Data Site</title>
        <link href="~/Site.css" rel="stylesheet" type="text/css" />
        <script src="../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
        <script src="../Scripts/jquery-ui-1.9.0.custom.min.js" type="text/javascript"></script>
        <link href="~/Styles/ui-lightness/jquery-ui-1.9.0.custom.css" rel="stylesheet" type="text/css" />
    
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>

    Do you have any idea why I'm getting the mentioned errors?

    Many thanks :)

    Monday, October 8, 2012 11:50 PM

All replies

  • Aslo I tried the following code but still I dont get datepicker!

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <link href="~/Styles/ui-lightness/jquery-ui-1.8.24.custom.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.8.24.custom.min.js" type="text/javascript"></script>
    <script type="text/ecmascript">
        $(document).ready(function () {
            $("#TextBox1").datepicker();
        });
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        </div>
        </form>
    </body>
    </html>
    

    Friday, October 12, 2012 12:50 AM