Home All Groups Group Topic Archive Search About
Author
29 Apr 2005 8:07 PM
Geoff
I have a datagrid with a button column. When the user clicks a button in the
datagrid, a PDF should open in a child window. To make this happen, I use
the grid's ItemDataBound event to add client side code to call a JavaScript
function to open the PDF window.

Most of the time it works correctly.

Maybe one time in ten the parent window gets the PDF and the child window is
blank. You can tell which is the parent and which is the child because
toolbars etc. are disabled on the child window.

Any idea why this happens?

Much obliged,
Geoff.

Author
1 May 2005 10:08 AM
Eliyahu Goldin
Geoff,

What javascript code do you make in ItemDataBound event?

Eliyahu

Show quoteHide quote
"Geoff" <Geoff.Pennington.ctr@NOSPAMwhs.mil> wrote in message
news:OyRO4cPTFHA.2520@TK2MSFTNGP09.phx.gbl...
> I have a datagrid with a button column. When the user clicks a button in
the
> datagrid, a PDF should open in a child window. To make this happen, I use
> the grid's ItemDataBound event to add client side code to call a
JavaScript
> function to open the PDF window.
>
> Most of the time it works correctly.
>
> Maybe one time in ten the parent window gets the PDF and the child window
is
> blank. You can tell which is the parent and which is the child because
> toolbars etc. are disabled on the child window.
>
> Any idea why this happens?
>
> Much obliged,
> Geoff.
>
>
Are all your drivers up to date? click for free checkup

Author
2 May 2005 11:52 AM
Geoff
Here is the code in the ItemDataBound event handler:

Private Sub dgControlNumList_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgControlNumList.ItemDataBound
    If e.Item.ItemType <> ListItemType.Header And _
        e.Item.ItemType <> ListItemType.Footer And _
        UCase(Request.Params("pAction")) = "VIEW" Then

        Dim btnPDF As LinkButton = e.Item.Cells(0).Controls(0)
        btnPDF.Attributes("onclick") = "OpenPDF('DD562PDF.aspx?pControlNum="
& _
        DataBinder.Eval(e.Item.DataItem, "ControlNum") & _
        "')"
    End If

End Sub

"OpenPDF()" is a JavaScript function copied into the page from a library.
This is what it looks like:
function OpenPDF(file) {
    PopUpWin=open(file,'pdfWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
    PopUpWin.focus();
    if (PopUpWin.opener == null)
        PopUpWin.opener = self;
}

Any clues?
Geoff.

Show quoteHide quote
"Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message
news:elsN9xiTFHA.2336@TK2MSFTNGP12.phx.gbl...
> Geoff,
>
> What javascript code do you make in ItemDataBound event?
>
> Eliyahu
>
> "Geoff" <Geoff.Pennington.ctr@NOSPAMwhs.mil> wrote in message
> news:OyRO4cPTFHA.2520@TK2MSFTNGP09.phx.gbl...
>> I have a datagrid with a button column. When the user clicks a button in
> the
>> datagrid, a PDF should open in a child window. To make this happen, I use
>> the grid's ItemDataBound event to add client side code to call a
> JavaScript
>> function to open the PDF window.
>>
>> Most of the time it works correctly.
>>
>> Maybe one time in ten the parent window gets the PDF and the child window
> is
>> blank. You can tell which is the parent and which is the child because
>> toolbars etc. are disabled on the child window.
>>
>> Any idea why this happens?
>>
>> Much obliged,
>> Geoff.
>>
>>
>
>

Bookmark and Share

Post Thread options