[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

ASP.NET opening a new browser

Hi Guys

I recently moved my frameset pageto a table and iFrames page. Now we have a new problem in as much that when we display an invoice in one frame we are not able to right-click and print just the content of the frame.

Yes, I've tried the javascript solutions to set the focus on the frame and then print it but they do not work.

I've tried javascript to break out of the frame by creating a new window. That one looked promising until I got the Access Denied problem because the content we are trying to display in the new window is an actual htm file stored on the web server.

I know some things ARE impossible but you guys have a habit of proving others wrong. I feel that the solution I need is a vb.net way of passing the file to the client browser then using javascript to open a new browser and post the info into it.

BTW: I'm lower than beginner on this one more like numbnuts:)
0
gjpitt
Asked:
gjpitt
  • 6
  • 4
3 Solutions
 
DauheeCommented:
if the html file is created on the server, would it be possible to write it out with something like:

Response.Clear()
Response.ContentType = "text/HTML"
Response.AddHeader("Content-Disposition", "inline; filename=" & IO.Path.GetFileName(strFileName).Replace(" ", "_"))
Response.WriteFile(strFileName)
Response.Flush()
Response.End()
0
 
DauheeCommented:
orelse javascript:

window.parent.frames(0).location.href = 'newpage.html'

not sure exactly what you are looking for though :)
0
 
gjpittAuthor Commented:
Thanks for coming back to me.

Previously we had a frameset with 4 frames one of which was called Main. In a diferent part of the site an invoice wold be created and stored as an html file on the server for later printing or emailing.
This was achieved by displaying the file in the frame, right-clicking and choosing print etc.

Now that we had had to move away from framesets we have moved to iFrames in a table so we have kept the same layout. We can display the invoice correct in the iFrame now called iFrameMain but right-clicking to print it prints the entire four iframes not the one we want.

Hope that clarifies things a little.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gjpittAuthor Commented:
Can I simplify things a little more. i believe I can find a way of issuing a javascript command but I need some help.

AllWebMenus Pro allows us to fire javascript commands when the button is clicked. The menu is in a different iFrame so does anyone know a javascript command for printing the content of an iFrame,

Each iFrame has a name and an ID and the one I need to print is iFrameMain.
0
 
gjpittAuthor Commented:
Closing this question to open a new shortly
0
 
DauheeCommented:
how bout this:

window.frames['iFrameMain'].focus();
window.frames['iFrameMain'].print();
0
 
gjpittAuthor Commented:

error: member not found
0
 
gjpittAuthor Commented:
A solution hs now been found

window.open('url') fired from a button click event.

Thanks for your help anyway
0
 
DauheeCommented:
glad you got sorted anyhow :)
0
 
gjpittAuthor Commented:
Thanks for your help
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now