I have the following:
<asp:TextBox ID="FromDateTxtBox" runat="server" Height="32px" style="border:solid black 1px; font-family: 'sakkal Majalla'; font-size: 24px; text-align: right;" Width="150px"></asp:TextBox><asp:CalendarExtender ID="Calendar1" runat="server" Format="dd-MMMM-yyyy" PopupButtonID="imgPopup" TargetControlID="FromDateTxtBox"></asp:CalendarExtender>
In the Page_Load event, I have:
If IsPostBack = False Then
.
.
.
FromDateTxtBox.Text = Format("01-01-2013", "dd-MMMM-yyyy")
Calendar1.SelectedDate = CDate("01-01-2013")
.
.
.
End IfThe AutoPostBack property of FromDateTxtBox is set toFalse
The problem I have is that any action I made in the page that makes the page to be postback (Button, DropDownList, Gridview radio button,....) causes the text value of the FromDateTxtBox to its initial value, which means losing the value entered by the user.
Thus, How can I prevent this behavior?