popup date picker cannot choose today's date

T

TB

Hi All:

A kind soul provided by with the code for very nice calendar popup, which
all in all works fine execpt for one thing: If I pick the current date (i.e.
today's date) then the pop-up does not close and the date value is not
returned to the target textbox. With any other date, everything works
flawlessly, ie the popup closes upon selecting a date and the selected date
is transfered to the corresponding textbox.

Since I don't want to post a lot of code here, initially I will only list
the what is in the calendarpopup.aspx.vb:

Public Class CalendarPopup
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents thedate As System.Web.UI.WebControls.Calendar
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents control As
System.Web.UI.HtmlControls.HtmlInputHidden

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region
Dim inidate As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
control.Value = Request.QueryString("textbox").ToString()
inidate = Request.QueryString("inidate").ToString()
thedate.SelectedDate = inidate
thedate.VisibleDate = inidate
Session.LCID = 1033
End Sub

Private Sub thedate_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles thedate.SelectionChanged
Dim script(4) As String

script(1) = "<script>window.opener.document.forms[0]." +
control.Value + ".value = '"
script(2) = thedate.SelectedDate.ToString("MM/dd/yyyy")
script(3) = "';self.close()"
script(4) = "</" + "script>"
RegisterClientScriptBlock("test", Join(script, ""))
End Sub
End Class

If that is not enough to find the error please let me know, so I can post
more code (for example the code generating the popup window).

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top