Click here to Skip to main content
15,917,321 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
AnswerRe: (DropDownList.DataSource == null) after postback Pin
Sandeep Mewara10-Aug-10 6:05
mveSandeep Mewara10-Aug-10 6:05 
GeneralRe: (DropDownList.DataSource == null) after postback Pin
Łukasz Nowakowski10-Aug-10 8:10
Łukasz Nowakowski10-Aug-10 8:10 
QuestionExcel Error :( Pin
Mugdha_Aditya10-Aug-10 3:12
Mugdha_Aditya10-Aug-10 3:12 
GeneralRe: Excel Error :( Pin
Paladin200010-Aug-10 3:51
Paladin200010-Aug-10 3:51 
AnswerRe: Excel Error :( Pin
Prosanta Kundu online10-Aug-10 18:07
Prosanta Kundu online10-Aug-10 18:07 
QuestionMore than one programmer working on the EF4 model file Pin
Brendan Vogt10-Aug-10 2:48
Brendan Vogt10-Aug-10 2:48 

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.