Solved

ASP.NET opening a new browser

Posted on 2008-06-23
10
180 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
Comment Utility
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
Comment Utility
orelse javascript:

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

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

Author Comment

by:gjpitt
Comment Utility
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
Comment Utility
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
Comment Utility
Closing this question to open a new shortly
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:Dauhee
Comment Utility
how bout this:

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

Author Comment

by:gjpitt
Comment Utility

error: member not found
0
 

Accepted Solution

by:
gjpitt earned 0 total points
Comment Utility
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
Comment Utility
glad you got sorted anyhow :)
0
 

Author Comment

by:gjpitt
Comment Utility
Thanks for your help
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

772 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

9 Experts available now in Live!

Get 1:1 Help Now