Pop-up Calendar with masterpage

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.
 
B

bruce barker \(sqlwork.com\)

if your popup window does a postback, this causes a render. in the new
rendered page, opener will no longer references the parent page, and there
is no way to access it.

if you need to postback, the popup should be a frameset, with the postback
page in the frame. then on postback it can access the frameset and its
opener. (parent.opener)

-- bruce (sqlwork.com)
 

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

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top