Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax Tool Kit Calendar Extendar control Issue

$
0
0

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. 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>