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

Closing webpage that calls download file

1
C#, .Net framework 1.1 visual studio 2003
From a aspx page I want to open the dialog box (download;save/open/cancel)
I want to close the aspx page after the dialogbox opens.
I open the dialog box from "Register.aspx.cs" with
Response.Redirect(sPathAndFile,false);
where sPathAndFile is the path and filename of a zipfile.

The sPathAndFile is filled by calling an SQL server database just before the Redirect


Response.Redirect(sPathAndFile,true); doesn't close the webpage

Response.Redirect(sPathAndFile,false);
followed by
Reponse.End doesn;'t work

calling
Response.Write("<script>window.close()</script>"); or
Response.Close();
don't work

What can I do?

private void OpenFile()
{
if (!(Test.Empty(Session[SessionVariableNames.UserId] ))&&(!Test.Empty(Session[SessionVariableNames.DatasetId] )))
{
sqlDataAdapterGetPathFileName.SelectCommand.Parame ters["@DatasetId"].Value =Session[SessionVariableNames.DatasetId] ;
sqlDataAdapterGetPathFileName.Fill(dataSetRegister Use1);
string sPathAndFile ;
sPathAndFile=dataSetRegisterUse1.dbo_ISRIC_GetPath AndFileName[0].PathDirectory;

Response.Redirect(sPathAndFile,false);
}
Jun 12 '07 #1
1 1082
Plater
7,872 Expert 4TB
What makes the call to that page? Is it an html link?
If you open your redirect page in a "new window" that new window never actually appears (it goes right to download/save/whatever dialog).
You could also attach a javascript on to it so that the page is closed.
Jun 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Patrick | last post by:
I am trying to download the html page at http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1 Using the code public class DownloadWebPage { public static void main (String...
1
by: Russell E. Owen | last post by:
I've been doing some socket programming with threads and am confused how to safely shut down a connection. First of all, using the file-like object returned by urllib to do ftp file download...
2
by: Anitha | last post by:
Hello All, Using Javascript and using one click, I have to close the window(pop up) and start the download of a file simultaneously. There will be a hyperlink in a pop up window as "Click here...
4
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
4
by: Jeff Cooper | last post by:
There must be something I'm missing. No else else seems to have this issue -- at least I don't see it mentioned anywhere. (Also, my appologies for my earlier posts in which I mistakenly referred...
5
by: Russell | last post by:
Hi all, I have a web page(a) that has a link to another web page(b). Now, on the page load event of web page(b), I am doing the following: Response.redirect("./test.pdf") This pdf, if the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
1
by: JRussell | last post by:
Hi, I am trying to download sql database through asp on my webpage and I keep getting weird outcomes in Excel. I have had to put in <char10> and <char13> into my sql data to have it display...
2
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
I am (still) relatively new to Windows applications, most of my experience has been Web based, and I am confused about what exactly happens when the Main() method is called and how to manipulate...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.