I got a way on how to do it. I am adding
AutoPostBack="true" on the Date To coding which is
<asp:textbox runat="server" id="dateTo" autopostback="true">
So I am adding these at code behind:
If IsPostBack Then
If dateFrom.Text <> "" AndAlso dateTo.Text <> "" Then
End If
End If