Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > popup date picker cannot choose today's date

Thread Tools

popup date picker cannot choose today's date

Posts: n/a
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

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

'NOTE: The following placeholder declaration is required by the Web Form
'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.
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).


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calender(date picker) table is scrolling with the popup window. Javascript 1 05-22-2008 07:05 AM
Require date and time picker in javascript without popup Javascript 1 07-16-2005 01:21 PM
Popup Date Picker for mutliple dates JAG Javascript 0 11-29-2004 07:41 PM
HTML popup date picker for input forms C. Smith Javascript 5 04-13-2004 12:25 AM
popup date picker luna ASP .Net 3 03-02-2004 08:39 AM