Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Wrong window gets the content

Reply
Thread Tools

Wrong window gets the content

 
 
Geoff
Guest
Posts: n/a
 
      04-29-2005
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.


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      05-01-2005
Geoff,

What javascript code do you make in ItemDataBound event?

Eliyahu

"Geoff" <> wrote in message
news:...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Geoff
Guest
Posts: n/a
 
      05-02-2005
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,locatio n=no,directories=no,status=no,menubar=no,copyhisto ry=no');
PopUpWin.focus();
if (PopUpWin.opener == null)
PopUpWin.opener = self;
}

Any clues?
Geoff.

"Eliyahu Goldin" <> wrote in message
news:...
> Geoff,
>
> What javascript code do you make in ItemDataBound event?
>
> Eliyahu
>
> "Geoff" <> wrote in message
> news:...
>> 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.
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Return of gets gets John Joyce Ruby 0 04-23-2007 01:38 PM
gets gets John Joyce Ruby 2 03-26-2007 04:00 PM
XMLHttpRequest gets data to display in element but data gets appended not replaces previous! libsfan01 Javascript 5 12-20-2006 06:25 AM
Not only the selected HREF gets surrounded, but the whole row gets surrounded Stefan Mueller HTML 5 07-10-2006 11:53 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57