473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Serve CSV file in new window

Hi,

Really stuck with this one, or the fact that I have just had a baby
maybe mind mind is in meltdown and I cant figure how to solve this!

I have a list of users stored in session. These users are displayed in
a list on the admin web page and I would like to give the
administrator a dropdown of actions on this list. For example, print
this list, Email this list etc.

The print list actually creates a PDF document so the admin can do what
they like with it, so this is where I get hazy.....

How do I open this PDF in a new window on a form submit? For example
with a link thats fine, target="_blank" but the form is posted back to
the server and I realise that there is no way of doing this at the
server, so at the moment I have a literal js statement that is set
visible true and this opens the new window when the page is rendered
after the postback.. This strikes me as *ahem* "not the best way" for
example with popup blockers etc.

Is there a way to render the page to a new window? I was perhaps
thinking of creating a PDF HTTPhandler which would force a download
which I hope will not move the window from the orignal page? Is this
the correct way?

Any help appreciated

Many thanks

Richard

Nov 6 '06 #1
3 1102
Add the target attribute to the form.

<form action="your pdf creating page.aspx" target="_blank">

"rgparkins" <rg*******@hotmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,

Really stuck with this one, or the fact that I have just had a baby
maybe mind mind is in meltdown and I cant figure how to solve this!

I have a list of users stored in session. These users are displayed in
a list on the admin web page and I would like to give the
administrator a dropdown of actions on this list. For example, print
this list, Email this list etc.

The print list actually creates a PDF document so the admin can do what
they like with it, so this is where I get hazy.....

How do I open this PDF in a new window on a form submit? For example
with a link thats fine, target="_blank" but the form is posted back to
the server and I realise that there is no way of doing this at the
server, so at the moment I have a literal js statement that is set
visible true and this opens the new window when the page is rendered
after the postback.. This strikes me as *ahem* "not the best way" for
example with popup blockers etc.

Is there a way to render the page to a new window? I was perhaps
thinking of creating a PDF HTTPhandler which would force a download
which I hope will not move the window from the orignal page? Is this
the correct way?

Any help appreciated

Many thanks

Richard

Nov 6 '06 #2
Hi Aidy

Hi Aidy thanks for your reply.. I understand that the web page in .NET
is contained within a single form element and I have many buttons and
links in this page as well as my dropdown & Go button to print labels,
print envelopes as options.. I cannot see how to add this target onto
just the dropdown and Go Button. I presume that if I add this to the
form element then all the buttons will form a new window?

Thanks again for your help

Rich

Aidy wrote:
Add the target attribute to the form.

<form action="your pdf creating page.aspx" target="_blank">

"rgparkins" <rg*******@hotmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,

Really stuck with this one, or the fact that I have just had a baby
maybe mind mind is in meltdown and I cant figure how to solve this!

I have a list of users stored in session. These users are displayed in
a list on the admin web page and I would like to give the
administrator a dropdown of actions on this list. For example, print
this list, Email this list etc.

The print list actually creates a PDF document so the admin can do what
they like with it, so this is where I get hazy.....

How do I open this PDF in a new window on a form submit? For example
with a link thats fine, target="_blank" but the form is posted back to
the server and I realise that there is no way of doing this at the
server, so at the moment I have a literal js statement that is set
visible true and this opens the new window when the page is rendered
after the postback.. This strikes me as *ahem* "not the best way" for
example with popup blockers etc.

Is there a way to render the page to a new window? I was perhaps
thinking of creating a PDF HTTPhandler which would force a download
which I hope will not move the window from the orignal page? Is this
the correct way?

Any help appreciated

Many thanks

Richard
Nov 6 '06 #3
there is no way to make the decision server side. you need to do it client
side. client code could change the form target.

-- bruce (sqlwork.com)

"rgparkins" <rg*******@hotmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,

Really stuck with this one, or the fact that I have just had a baby
maybe mind mind is in meltdown and I cant figure how to solve this!

I have a list of users stored in session. These users are displayed in
a list on the admin web page and I would like to give the
administrator a dropdown of actions on this list. For example, print
this list, Email this list etc.

The print list actually creates a PDF document so the admin can do what
they like with it, so this is where I get hazy.....

How do I open this PDF in a new window on a form submit? For example
with a link thats fine, target="_blank" but the form is posted back to
the server and I realise that there is no way of doing this at the
server, so at the moment I have a literal js statement that is set
visible true and this opens the new window when the page is rendered
after the postback.. This strikes me as *ahem* "not the best way" for
example with popup blockers etc.

Is there a way to render the page to a new window? I was perhaps
thinking of creating a PDF HTTPhandler which would force a download
which I hope will not move the window from the orignal page? Is this
the correct way?

Any help appreciated

Many thanks

Richard

Nov 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mep | last post by:
Hi, After lookup in cherrypy site and google for a while, I haven't found any information about cherrypy how to serve dynamic binary file(some generated charts).Is there any easy way to do this?...
3
by: Chris Tanger | last post by:
I am creating a class that has a method "Write" that I wish to make threadsafe. The method must block calling threads until the task performed in write is complete. Only 1 thread at a time can...
11
by: Mark J. McGinty | last post by:
Greets, One site I've written allows the user to install an IE extension menu (not malware at all) by downloading/merging a short .REG file. Worked like a peach on Win2K Server, now that I...
21
by: Hattuari | last post by:
I'm learning C++ after having spent several years in the computer industry doing both system administration and engineering. I've written code in Perl, Bash, Pascal, Ada, C, Mathematica (hundreds...
3
by: Ricky K. Rasmussen | last post by:
Hi NG, Is it possible in any way to serve an ASP.NET server control when the request is beeing processed by a custom request handler? In my case I use my own request handler to serve elements...
22
by: petermichaux | last post by:
Hi, I'm curious about server load and download time if I use one big javascript file or break it into several smaller ones. Which is better? (Please think of this as the first time the scripts...
1
by: Ray Schumacher | last post by:
I'm trying to make a small camera server using VideoCapture.py and socket. I needed to construct a complete image file with headers etc for a browser to recognize it, but I couldn't find a...
4
by: Alice | last post by:
How can I make php script serve up an *.html file 'server-parsed' for SSI's? The goal is to pre-process all *.html files with php script, but the SSI's need to be handled too. Problem with...
0
by: tregan3 | last post by:
I have an ashx page that serves *.wav files. If I serve them up as attachments, it works fine. This code works; I get the usual web browser prompt asking me if I want to save or open, and the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.