Open new web page with Response.Redirect or something else?

G

Guest

I have a web page that is designed to allow users to run crystal reports
which are then exported into PDF formats. Currently, when the user clicks
the "Submit" button there is some processing to build the PDF file and then I
use a Response.Redirect("Exported\\crystal_report_name.pdf)"; command to
redirect the page. However, the user wants the PDF file to open in a new
window. Is there a way I can do this? It doesn't have to be
Response.Redirect, just some way to open a new window basically and then I
can always pass the file name and redirect on the page load. Thanks for any
help!

Ed
 
N

Nicholas Paldino [.NET/C# MVP]

Ed,

What you want to do on your page is add the target element to your form
(you have to be careful, because target on the ASPX page is going to be set
to "server", and that's not what you want processed). You can set the
target attribute to a name of the window that the result should be in. If
there is no window with that name, then a new one with that name is created.

Hope this helps.
 
G

Guest

Nicholas,

I appreciate your help, but I'm still very confused. I don't know what you
mean by "add the target element to your form". Also, how and when would I
set the target attribute? Do you have an example you can direct me to or
anything? Web Apps are not my speciality (obviously), so I'm not familiar
with some things that are probably obvious. I appreciate any additional help
you can provide.

Ed

Nicholas Paldino said:
Ed,

What you want to do on your page is add the target element to your form
(you have to be careful, because target on the ASPX page is going to be set
to "server", and that's not what you want processed). You can set the
target attribute to a name of the window that the result should be in. If
there is no window with that name, then a new one with that name is created.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

eieed said:
I have a web page that is designed to allow users to run crystal reports
which are then exported into PDF formats. Currently, when the user clicks
the "Submit" button there is some processing to build the PDF file and
then I
use a Response.Redirect("Exported\\crystal_report_name.pdf)"; command to
redirect the page. However, the user wants the PDF file to open in a new
window. Is there a way I can do this? It doesn't have to be
Response.Redirect, just some way to open a new window basically and then I
can always pass the file name and redirect on the page load. Thanks for
any
help!

Ed
 
N

Nicholas Paldino [.NET/C# MVP]

Ed,

On the client side, if you have a form like this:

<form action="http://www.mysite.com/processForm.aspx">
<!--- Other stuff -->
</form>

You can change it to this, and it will open the results of processing
the form in a new window:

<form action="http://www.mysite.com/processForm.aspx" target="newWindow">
<!--- Other stuff -->
</form>

Now, in ASP.NET, you have this in your ASPX page:

<form runat="server" target="newWindow">
<!--- Other stuff -->
</form>

And that will open it in a new window (with the name "newWindow").

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

eieed said:
Nicholas,

I appreciate your help, but I'm still very confused. I don't know what
you
mean by "add the target element to your form". Also, how and when would I
set the target attribute? Do you have an example you can direct me to or
anything? Web Apps are not my speciality (obviously), so I'm not familiar
with some things that are probably obvious. I appreciate any additional
help
you can provide.

Ed

Nicholas Paldino said:
Ed,

What you want to do on your page is add the target element to your
form
(you have to be careful, because target on the ASPX page is going to be
set
to "server", and that's not what you want processed). You can set the
target attribute to a name of the window that the result should be in.
If
there is no window with that name, then a new one with that name is
created.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

eieed said:
I have a web page that is designed to allow users to run crystal reports
which are then exported into PDF formats. Currently, when the user
clicks
the "Submit" button there is some processing to build the PDF file and
then I
use a Response.Redirect("Exported\\crystal_report_name.pdf)"; command
to
redirect the page. However, the user wants the PDF file to open in a
new
window. Is there a way I can do this? It doesn't have to be
Response.Redirect, just some way to open a new window basically and
then I
can always pass the file name and redirect on the page load. Thanks
for
any
help!

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top