Pretty simple, here is the js:

 <script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
<link href="" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {


    //Set the default date today
    $(document).ready(function () {
        var currentDate = new Date();
        $("#txt_Date").datepicker("setDate", currentDate);


Here is the control on the page. The page has a master page and in the content area the control is nested in an asp:Table, asp:TableRow, asp:TableCell structure.

<asp:TextBox ID="txt_Date" columns="30" runat="server" ReadOnly="true" name="RequestDate"></asp:TextBox>

Here is the code behind where I attempt to capture the value on a submit_click:

Date = Convert.ToDateTime(Request.Form["txt_Date"]);

I have also tried:

Date = Convert.ToDateTime(Request.Form["RequestDate"]);

Every attempt has returned 01/01/0001 as the date which I am guessing is just the default when it reads a NULL value from the control I am sure this is probably simple but I must be missing it.

Related posts

Recent Viewed