Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue in DateTime Picker MVC2
    primarykey
    data
    text
    <p>I had done a application with DateTime Picker. Current Date is displaying in the control. But the calender is not working.Whenever i click the TextBox nothing happens..</p> <p>Here is my Code in Site.Master</p> <pre><code> &lt;title&gt; &lt;asp:ContentPlaceHolder ID="TitleContent" runat="server" /&gt; &lt;/title&gt; &lt;link href="../../Content/Site.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="../../Content/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../../Scripts/jquery-ui-1.8.1.custom.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#UseDatePicker").live('click', function () { $(this).datepicker('destroy').datepicker({ showOn: 'focus', changeMonth: true, changeYear: true }).focus(); }); }); &lt;/script&gt; </code></pre> <p>In my index.aspx...</p> <pre><code>&lt;p&gt;&lt;%:Html.LabelFor(m =&gt; m.MyDate)%&gt;:&amp;nbsp;&lt;%:Html.EditorFor(m =&gt; m.MyDate) %&gt;&lt;/p&gt; </code></pre> <p>In my Model.cs</p> <pre><code> [DisplayName("Date")] public DateTime MyDate { get; set; } </code></pre> <p>In my DateTime.ascx</p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;System.DateTime?&gt;" %&gt; &lt;%=Html.TextBox("", (Model.HasValue ? Model.Value.ToString("MM/dd/yyyy") : DateTime.Today.ToShortDateString()), new { @class = "UseDatePicker date-text-box" })%&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload