Solved

ASP.NET opening a new browser

Posted on 2008-06-23
10
181 Views
Last Modified: 2013-11-26
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
Comment
Question by:gjpitt
  • 6
  • 4
10 Comments
 
LVL 7

Assisted Solution

by:Dauhee
Dauhee earned 500 total points
ID: 21853644
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
 
LVL 7

Assisted Solution

by:Dauhee
Dauhee earned 500 total points
ID: 21853677
orelse javascript:

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

not sure exactly what you are looking for though :)
0
 

Author Comment

by:gjpitt
ID: 21855978
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
 

Author Comment

by:gjpitt
ID: 21856722
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
 

Author Comment

by:gjpitt
ID: 21856805
Closing this question to open a new shortly
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 7

Expert Comment

by:Dauhee
ID: 21863263
how bout this:

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

Author Comment

by:gjpitt
ID: 21865368

error: member not found
0
 

Accepted Solution

by:
gjpitt earned 0 total points
ID: 21867709
A solution hs now been found

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

Thanks for your help anyway
0
 
LVL 7

Expert Comment

by:Dauhee
ID: 21872342
glad you got sorted anyhow :)
0
 

Author Comment

by:gjpitt
ID: 21876442
Thanks for your help
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now