Click here to Skip to main content
15,890,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionEmbedded Resources in base class [modified] Pin
Fayu11-Aug-10 12:26
Fayu11-Aug-10 12:26 
Questionsite accessing Pin
netJP12L11-Aug-10 11:05
netJP12L11-Aug-10 11:05 
QuestionApplication cache problem Pin
shaul almog11-Aug-10 8:00
shaul almog11-Aug-10 8:00 
AnswerRe: Application cache problem Pin
Eaverae16-Aug-10 20:56
Eaverae16-Aug-10 20:56 
QuestionDirectory listening denied [modified] Pin
moein.serpico11-Aug-10 4:20
moein.serpico11-Aug-10 4:20 
AnswerRe: Directory listening denied Pin
Gregory Gadow11-Aug-10 4:58
Gregory Gadow11-Aug-10 4:58 
AnswerRe: Directory listening denied Pin
Sandeep Mewara11-Aug-10 7:05
mveSandeep Mewara11-Aug-10 7:05 
QuestionHow to close an aspx page from code behind? Pin
Raheem MA11-Aug-10 1:09
Raheem MA11-Aug-10 1:09 
Hello Friends,

We have the following issue, please help us in getting rid of it.

Scenario:

We have an aspx page which contains two button controls. On click event of first button, generating excel sheet and prompting the user with the open/save dialog box.

Requirement:

Once the excel file generated and open/save dialog prompts to the user, the main window (which has two button controls) should be closed.

We are using the following code to return generated excel file:

Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
string excelReportName = "MpmCostDataTemplate";
Response.AddHeader("Content-Disposition", "attachment; filename=" + excelReportName + ".xlsx");
..........................


and using the following statement to close the main aspx page window
Page.ClientScript.RegisterStartupScript(this.GetType(), "myCloseScript", "window.close();", true);

Issue is:

The above close statement is working fine if we remove the Response related code (that returns the excel file to the user). But its not working when we have Response related code in place.

Please let us know how can we get rid of this issue when we use Response kind of code.

Thank you,
Raheem MA
AnswerRe: How to close an aspx page from code behind? Pin
Not Active11-Aug-10 2:34
mentorNot Active11-Aug-10 2:34 
GeneralRe: How to close an aspx page from code behind? Pin
Raheem MA11-Aug-10 20:48
Raheem MA11-Aug-10 20:48 
GeneralRe: How to close an aspx page from code behind? Pin
Not Active12-Aug-10 2:21
mentorNot Active12-Aug-10 2:21 
AnswerRe: How to close an aspx page from code behind? Pin
tanweer11-Aug-10 23:26
tanweer11-Aug-10 23:26 
GeneralRe: How to close an aspx page from code behind? Pin
Raheem MA11-Aug-10 23:51
Raheem MA11-Aug-10 23:51 
QuestionScheduler implementation in ASP.Net Pin
Amit Patel198511-Aug-10 0:26
Amit Patel198511-Aug-10 0:26 
AnswerDayPilot Pin
David Mujica11-Aug-10 3:22
David Mujica11-Aug-10 3:22 
AnswerRe: Scheduler implementation in ASP.Net Pin
m@dhu11-Aug-10 18:47
m@dhu11-Aug-10 18:47 
Questionsliding or collapsible display Pin
Vinay Varghese10-Aug-10 22:21
Vinay Varghese10-Aug-10 22:21 
AnswerRe: sliding or collapsible display Pin
Sandeep Mewara10-Aug-10 22:27
mveSandeep Mewara10-Aug-10 22:27 
GeneralRe: sliding or collapsible display Pin
Vinay Varghese12-Aug-10 13:06
Vinay Varghese12-Aug-10 13:06 
QuestionSiteMapPath: Don’t show the root level in breadcrumb Pin
anderslundsgard10-Aug-10 19:30
anderslundsgard10-Aug-10 19:30 
AnswerRe: SiteMapPath: Don’t show the root level in breadcrumb Pin
Prosanta Kundu online10-Aug-10 20:48
Prosanta Kundu online10-Aug-10 20:48 
GeneralRe: SiteMapPath: Don’t show the root level in breadcrumb Pin
anderslundsgard11-Aug-10 18:51
anderslundsgard11-Aug-10 18:51 
Questionsome IEEE projects in ASP.NET Pin
ram_kesari10-Aug-10 17:28
ram_kesari10-Aug-10 17:28 
AnswerRe: some IEEE projects in ASP.NET Pin
Prosanta Kundu online10-Aug-10 18:13
Prosanta Kundu online10-Aug-10 18:13 
Question(DropDownList.DataSource == null) after postback Pin
Łukasz Nowakowski10-Aug-10 4:53
Łukasz Nowakowski10-Aug-10 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.