W
warrengo
I have a 2.0 asp app and i'm trying to implement a pop-up calendar. I
can get the calendar to pop-up and select a value, but can not get the
value to pass back to the calling page. Here is the code i'm using:
code linked to an html button
function Button5_onclick(evt) {
//OBTAIN CURRENT X-Y POSITION
var CurX = parseInt(evt.x);
var CurY = parseInt(evt.y);
window.open('calendar.aspx?contentname=document.forms[0].elements[' +
'<%= lblDate.ClientID %>' +
']','cal','width=164,height=188').moveTo(CurX,
CurY);//calendar.focus();
//window.open('calendar.aspx?contentname=ContentPlaceHolder1$lblDate','cal','width=164,height=188').moveTo(CurX,
CurY);//calendar.focus();
}
Code on the pop-up window
Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e
As System.EventArgs)
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." &
HttpContext.Current.Request.QueryString("contentame") & _
".value = '" & Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub
Thanks for any help.
can get the calendar to pop-up and select a value, but can not get the
value to pass back to the calling page. Here is the code i'm using:
code linked to an html button
function Button5_onclick(evt) {
//OBTAIN CURRENT X-Y POSITION
var CurX = parseInt(evt.x);
var CurY = parseInt(evt.y);
window.open('calendar.aspx?contentname=document.forms[0].elements[' +
'<%= lblDate.ClientID %>' +
']','cal','width=164,height=188').moveTo(CurX,
CurY);//calendar.focus();
//window.open('calendar.aspx?contentname=ContentPlaceHolder1$lblDate','cal','width=164,height=188').moveTo(CurX,
CurY);//calendar.focus();
}
Code on the pop-up window
Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e
As System.EventArgs)
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." &
HttpContext.Current.Request.QueryString("contentame") & _
".value = '" & Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub
Thanks for any help.