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 returned
to the target textbox. With any other date, everything works flawlessly.
Since I don't 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,
TB
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 returned
to the target textbox. With any other date, everything works flawlessly.
Since I don't 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,
TB