[CLOSED] [1.0] ext:hidden/date bug?

  1. #1

    [CLOSED] [1.0] ext:hidden/date bug?

    Hi,
    I'm trying to retrieve the date stored in a hidden field. With 0.8.2 works fine, but with 1.0 I get another result. Date(1259067465015+0700)

    Here is a sample code

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                hDate.Value = DateTime.Now;
                lDate.Text = Convert.ToString(hDate.Value);
            }
        }
        [DirectMethod]
        public void test()
        {
            string d = (string)hDate.Value;
            lDate.Text = d;
        }    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>test</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Hidden runat="server" ID="hDate"></ext:Hidden>    
            <ext:Label runat="server" ID="lDate"></ext:Label>
            <ext:Button runat="server" Text="Test">
                <Listeners>
                    <Click Handler="Ext.net.DirectMethods.test();" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  2. #2

    RE: [CLOSED] [1.0] ext:hidden/date bug?

    Hi,


    What is the expected result? Just .NET DateTime is converted to the JavaScript DateTime format (Microsoft AJAX serialized date)


    Try to deserialize.


     DateTime d = JSON.Deserialize<DateTime>(hDate.Value);

  3. #3

    RE: [CLOSED] [1.0] ext:hidden/date bug?

    I was expecting to see the value of lDate.Text (in example)
    Anyway your solution works for me.
    Thanks!

Similar Threads

  1. Replies: 3
    Last Post: May 09, 2012, 4:28 PM
  2. Replies: 2
    Last Post: Apr 23, 2012, 12:47 PM
  3. Replies: 4
    Last Post: Jun 30, 2011, 3:30 PM
  4. [CLOSED] Displaying Todays date in Date field
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 22, 2011, 10:38 AM
  5. [CLOSED] How to Set Date Format in a Coolite Date Field
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 02, 2010, 8:47 AM

Posting Permissions