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:)
gjpittAsked:
Who is Participating?
 
gjpittConnect With a Mentor Author Commented:
A solution hs now been found

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

Thanks for your help anyway
0
 
DauheeConnect With a Mentor Commented:
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
 
DauheeConnect With a Mentor Commented:
orelse javascript:

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

not sure exactly what you are looking for though :)
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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
 
DauheeCommented:
glad you got sorted anyhow :)
0
 
gjpittAuthor Commented:
Thanks for your help
0
All Courses

From novice to tech pro — start learning today.