I've been looking every for a simple Popup calender solution for my VWD site. I came across this bit of code and I got the popup with the calender displayed but the calender doesn't close and populate my text box field on the calling page. Here is the code to pass the value and close the calendar window:
Dim
strjscript As String = "<script language=""javascript"">"strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname") & ".value = '" & _Calendar1.SelectedDate & "';window.close();"
Literal1.Text = strjscript
which looks like this when built as a string:
"<script language="javascript">window.opener.frmCalendar.txtDate.value = '25/11/2005';window.close();"
So, essentially this is suppose to put the date "25/11/2005" in the textbox: txtDate of the window that called this popup and close the Calendar picker window. When I run this however, nothing happens. If I change the script to:
"<script language="javascript">window.close();"
It closes the window, so with some deduction.... LOL there must be something wrong with window.opener.frmCalendar.txtDate.value = '25/11/2005'; One other note: this txtDate field is located within a MasterPage. I read somewhere that a person had the same problem and when he removed the page from being a part of the masterpage everything worked. Any help would be greatly appreciated. Thanks

Need help with Popup Calender, won't close and update Textfield
ebaklund
Pete,
No offense; however, I find the lack of suitable search function in he various areas on the ASP.NET forum distracting to say the least. Perhaps you should try it and think of yourself as a 'end user' to the product.
I appreciate the effort being put in place to support ASP.NET; however, unless I'm missing something the search box does not work very well there.
For example, I entered the word 'calendar' in the search. No records returned had anything to do with calendar.
circuitblood
Hi!!
Thanks for asking! I'm a member of the ASP.NET team, and was just popping over here to see what was going on. The best place to ask ASP.NET questions is over on the ASP.NET forums at
http://www.asp.net/welcome.aspx tabindex=1&tabid=39HTH,
PEte