question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker automatically causing a postback in ASP.NET

See original GitHub issue

I use Datepicker with an ASP.NET Web Forms site. Version 1.4.1 worked fine for me but as of 1.5.0 I am noticing the following bug:

If an ASP.NET TextBox with the setting “AutoPostBack=true” is used as the base element for a Datepicker, the datepicker code automatically triggers a page postback, which causes the page to reload, which causes the postback to be triggered, etc. In other words, the page keeps refreshing indefinitely.

It is not easy to make a sample snippet of ASP.NET code but here is how I am creating a textbox:

        <asp:TextBox runat="server" ID="rangeStartBox" CssClass="input-small datepicker" AutoPostBack="true"/>

Normally that should trigger a POST only when the textbox is actually changed, but starting in 1.5.0 a POST is triggered every time the Datepicker is initialized.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MrBenjaminRaycommented, May 10, 2017

This is fixed in the upcoming version 1.7.0.

See the commit here: https://github.com/uxsolutions/bootstrap-datepicker/commit/110b12072cf424480a7fe0cd10ec917458a2e4a8

0reactions
shivakadakolcommented, Jun 13, 2018

this.fill(); //this.element.change(); return this;

work fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery DatePicker goes away after postback. - MSDN - Microsoft
I am using the version 1.8.5 DatePicker on a page in an ASP.Net 3.5 application. It is being used in an Ajax Modal...
Read more >
Datepicker automatically causing a postback in ASP.NET
I use Datepicker with an ASP.NET Web Forms site. Version 1.4.1 worked fine for me but as of 1.5.0 I am noticing the...
Read more >
asp.net - Boostrap datetimepicker not triggering asp textbox's ...
Isn't that as documented? Use the AutoPostBack property to specify whether an automatic postback to the server will occur when the TextBox control...
Read more >
ASP.NET Calendar - Tutorial - Handling postbacks - Obout
By default, calendar doesn't automatically post back when date is selected. To make it post back automatically, set AutoPostback property to true. You...
Read more >
JQuery UI inline DatePicker loses selected date after ASP ...
when select date from datepicker the TextChanged for textbox fired and do postback. c# Code behind: protected void txtRDate_TextChanged(objec. t ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found