| re: Pop-up Calendar with masterpage
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)
<warrengo@gmail.com> wrote in message
news:1145472338.129930.26710@i39g2000cwa.googlegro ups.com...[color=blue]
>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.fo rms[0].elements[' +
> '<%= lblDate.ClientID %>' +
> ']','cal','width=164,height=188').moveTo(CurX,
> CurY);//calendar.focus();
>
> //window.open('calendar.aspx?contentname=ContentPlac eHolder1$lblDate','cal','width=164,height=188').mo veTo(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("contentam e") & _
> ".value = '" & Calendar1.SelectedDate & "';window.close();"
> strjscript = strjscript & "</scr" & "ipt>"
> Literal1.Text = strjscript
> End Sub
>
> Thanks for any help.
>[/color] |