473,387 Members | 1,492 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,387 software developers and data experts.

Multiple File Download Dialog windows with one click

I have a situation where I want to bring up two "File Download" dialog
windows to download two separate .xls files.

Is there any way to do this by only clicking on one "Export" button?
--
Thanks In advance,

John Scott.
Aug 31 '05 #1
4 1979
John,

A dialog is a dialog, which means it stops the thread until there is an
answer.

However I really don't understand what your purpose is from this?

A user cannot select two files in one time.

I would go for two textboxes, two seperated file dialogs and an
AcceptButton.

Cor
Sep 1 '05 #2
Hey Cor,

I guess I didn't explain myself very well...I basically want to stream out
the contents of a datagrid into an .xls file. The question/problem is I have
two datagrids that need to be streamed out. Is there a way to stream both
datagrids to separate xls files with separate Open/Save dialog windows coming
up?

Right now I click on 1 button and it generate the first xls with no problems
and brings up the Open/Save dialog window, but...then I want to continue to
generate the second datagrid into an xls and bring up a second Open/Save
dialog window to save the xls file....I don't even know if it's
possible....that's where you come in....is this possible to do? Did I
explain it a little better?

--
Thanks,

John Scott.
"Cor Ligthert [MVP]" wrote:
John,

A dialog is a dialog, which means it stops the thread until there is an
answer.

However I really don't understand what your purpose is from this?

A user cannot select two files in one time.

I would go for two textboxes, two seperated file dialogs and an
AcceptButton.

Cor

Sep 1 '05 #3
John,

You mean just is pseudo

mySaveDialog.showdialog
writexml("mysaveDialog.file)
mySaveDialog.showdialog
writexml("mysaveDialog.file)

Why not?

Cor
Sep 1 '05 #4
Just so we're on the same page...
Here is a snippet of what I have that works right now:

Response.Clear();
Response.Charset ="";

//set the response mime type for excel
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;filename=Filename.xls");

//create a string writer
System.IO.StringWriter stringWrite = new System.IO.StringWriter();

//create an htmltextwriter which uses the stringwriter
System.Web.UI.HtmlTextWriter htmlWrite = new
System.Web.UI.HtmlTextWriter(stringWrite);

DataSet ds = Session["somedatagrid"]
DataGrid dg = new DataGrid();
//'instantiate a datagrid
dg.DataSource = ds.Tables[0];
dg.DataBind();

//tell the datagrid to render itself to our htmltextwriter
dg.RenderControl(htmlWrite);

//all that's left is to output the html
Response.Write(stringWrite.ToString());
/********************************/
//THIS IS WHERE THE OPEN/SAVE DIALOG WINDOW POPS UP

I want to essentially call the exact same snippet of code but use a
different dataset.
Can I do it this way....or any other way?

--
Thanks,

John Scott.
"Cor Ligthert [MVP]" wrote:
John,

You mean just is pseudo

mySaveDialog.showdialog
writexml("mysaveDialog.file)
mySaveDialog.showdialog
writexml("mysaveDialog.file)

Why not?

Cor

Sep 1 '05 #5

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

Similar topics

2
by: yanivoliver | last post by:
Hey, I'm currently trying to find a way to open a dialog box that will allow me to select more than one file at a time, so if I want to upload select all the files in a directory, I won't have...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
4
by: Nathan Sokalski | last post by:
I want to give visitors to my site the option of downloading a generated ..txt file by clicking a button. I know how to generate text files, but how do I cause the browser to pop up one of those...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
5
by: Stanav | last post by:
Hello all, Thanks in advance for any replies... Now, my question is: Is it possible to do a multiple files download for a single response event on an aspx page? If there is, please give me some...
4
by: John Scott | last post by:
I have a situation where I want to bring up two "File Download" dialog windows to download two separate .xls files. Is there any way to do this by only clicking on one "Export" button? --...
4
by: Jonny | last post by:
Hello Group How do I open a Save File Dialog from an ASPX page behind a browse button? Any help would be fantastic!! I am using ASP.NET 1.1 using VB.NET as the coding language TIA
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.