locked
Ajax Tool Kit Calendar Extendar control Issue RRS feed

  • Question

  • User2128760233 posted

    Hello Team,

    I have a issue using ajax calendar extender control. In my form, i have Dropdownlist, textbox , Linkbutton controls. On each click of either  linkbutton or selection an item from the drop down list  the date field changes the date automatically reducing the date by 1 day. I am using Visual Studio 2015 + AjaxToolKit 16.1.0 (in my project). Below is the code of my page. when i debug and check the value of the control everthing is fine  but still the date is getting reduced by 1 day automatically.

    protected void Page_Load(object sender, EventArgs e)
    {
    if ((!string.IsNullOrEmpty(Session["UserID"] as string)) && (!string.IsNullOrEmpty(Session["RegID"] as string)))
    {
    if (!Page.IsPostBack)
    {
    //aceDocDate.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
    //aceDocToDate.SelectedDate = DateTime.Now;
    txtDocDate.Text = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("dd/MM/yyyy");
    txtDocToDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
    GetAllBranchesAndUsers(Convert.ToInt32(Session["RegID"]), Convert.ToInt32(Session["UserID"]));
    }
    else
    {

    if (Request[txtDocDate.UniqueID] != null)
    {
    if (Request[txtDocDate.UniqueID].Length > 0)
    {
    txtDocDate.Text = Request[txtDocDate.UniqueID];
    //aceDocDate.SelectedDate = DateTime.Parse(Request[txtDocDate.UniqueID]);
    }
    }

    if (Request[txtDocToDate.UniqueID] != null)
    {
    if (Request[txtDocToDate.UniqueID].Length > 0)
    {
    txtDocToDate.Text = Request[txtDocToDate.UniqueID];
    //aceDocToDate.SelectedDate = DateTime.Parse(Request[txtDocToDate.UniqueID]);
    }
    }
    }

    }
    else
    {
    ClientScript.RegisterStartupScript(GetType(), "Load", "<script type='text/javascript'>parent.location = 'login'; </script>");
    }
    }

    It has been 2 days i am trying to resolve this issue but all in vain, Kindly help. 

    Sunday, July 2, 2017 7:15 AM

All replies

  • User549093279 posted

    DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("dd/MM/yyyy"); 

    Here remove the 1 

    Sunday, July 2, 2017 10:02 AM
  • User2128760233 posted

    Hi Sundaram,

    I removed 1, but this the same thing happening. 

    Apart from this i updated the Ajaxtoolkit from version 16.1.0  to 17.1.1 through Nuget packages, this issue got resolved., but when i upload this form to live server the issue remains the same. Also in other screens we have used Ajax TabControl. The design of it is getting disturbed as a custom css has been created by previous developers for tab control.

    When i revert Ajax ToolKit back to 16.1.0 the date issue is getting resolved locally but the Tab control issue arose. so i reverted back the whole project from the back up i had taken. 

    Can you please tell under what circumstances this can happen.

    Sunday, July 2, 2017 10:30 AM
  • User-271186128 posted

    Hi krunalshaholia,

    Can you please tell under what circumstances this can happen.

    I’ve tested your code and it works fine on my side. And from your description, if you are sure about the issue is caused by the version, I suggest you could post your issues to github at the following link, and feedback this issue to DevExpress:

    https://github.com/DevExpress/AjaxControlToolkit/issues 

    If you have any other questions, please feel free to contact me any time.

    Best regards,
    Dillion

    Monday, July 3, 2017 8:23 AM