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 6549793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:08:12+00:00 2026-05-25T12:08:12+00:00

I have a gridview in an update panel. I can export it to an

  • 0

I have a gridview in an update panel. I can export it to an excel using HTTP response and it exports the required data and open the file in a pop up which is all working fine.

But, once the data is exported I have to update the grid view indicating that these data were exported. I verified the correct data is set to the data source and databind is called. But the excel export is not triggering the screen to refresh.

If I trigger a refresh by changing a drop down or by something else, I can see the data changed. I tried UpdatePanelID.Update() – still in vain.

So how to trigger a gridview refresh after the excel export?

Thanks in advance.

My code for export:

        var excelXml = GetExcelXml(dsInput, filename);
        response.Clear();
        response.AppendHeader("Content-Type", "application/vnd.ms-excel");
        response.AppendHeader("Content-disposition", "attachment; filename=" + filename);
        response.Write(excelXml);
        response.Flush();

protected void btnExport_Click(object sender, EventArgs e)
{
    try
    {

        if (list.Count() > 0)
        {


            ds.Tables.Add(dtForExport);
            ExcelHelper.ToExcel(ds, filename); //To Excel method is described above.
            LoadGridDetails();//Binds the new values

        }

    }
    catch (Exception ex)
    {
        lblStatus.Text = "Error Exporting to Excel";
    }
}//Screen is not refreshed after executing this line.
  • 1 1 Answer
  • 0 Views
  • 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-25T12:08:13+00:00Added an answer on May 25, 2026 at 12:08 pm

    What you call a «Popup», it seems to me that you are talking about the browser download popup.
    So, in this case, it wont work, because you already did an Response.Clear and you can’t anymore do an refresh of your grid.

    My suggestion is: you can open an real popup it means: window.popup, and this popup will do all the response job, or you can also put some java-script in your button “export” to do two things: do the post-back to export function and wait X milliseconds to call a click of some hidden button just to make a second post-back and do the refresh.

    Hope it helps

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

Sidebar

Related Questions

I have a gridview in an update panel and am using a jQuery dialog
i'm using an gridview inside the update panel.now in that grid i have 3
I have a gridview inside an update panel, that is doing inline editing. When
I have a gridview in an update panel with the following code to select
I have a gridview in update panel and I am doing paging in that,
I have an update panel and a gridview. Within the gridview i have a
I have a gridview inside an update panel.In that gridview, I have a linkbutton
I have a gridview inside a content template inside an update panel. The aspx
I'm using the ASP net Ajax toolkit and have a GridView within the UpdatePanel
I have a gridview with multiple rows, each has a Update button and I

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.