Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 784007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:38:34+00:00 2026-05-14T20:38:34+00:00

We have a web part on which we display some data in a grid.

  • 0

We have a web part on which we display some data in a grid. We are exporting grid’s underlying datatable to Excel and displaying Open – Save – Cancel dialouge box on click of a server side button.

Following is the code we are executing on click of server side button.

this.Page.Response.Clear();
this.Page.Response.AppendHeader("Content-Disposition", "attachment; filename=MyTasks.xls");
this.Page.Response.ContentType = "application/ms-excel";
this.Page.Response.Write("...here goes my well formated html....");
this.Page.Response.End();

Problem is that when i click on Cancel in the diaglouge box then dialogue box to Open/Save excel disappears but all the server side buttons placed on my web part becomes non responsive, on click of any of those buttons their server side click event does not get fired !!!

Any idea ?

Thanks.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:38:34+00:00Added an answer on May 14, 2026 at 8:38 pm

    i got it, I had to open the same page using window.open script which i executed using RegisterStartupScript on Server side button click event (on which i am exporting data table to excel) and on page load i will check if export to excel button was clicked then execute the above mentioned code to render excel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom web part which is generating some user data. I have
I have a web part which uses many SharePoint controls like menu, SPGrid, tool
I have web application of which major part is javascript. I request images from
I have a SharePoint web part that I wrote in C# which is used
I have a tool which manipulates images at runtime as part of my web
I have written a web part in C# for Sharepoint 2007 which has a
The Back Story I have some decimal values which I am displaying as strings
I have some JSON data which is in the following format: [ { id:
I'm developing a Java web app in which in some cases i have to
We have a web part that uploads a document to a document library. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.