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

  • Home
  • SEARCH
  • 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 8532629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:45:31+00:00 2026-06-11T09:45:31+00:00

When the user clicks on the Export to Excel link, the standard File download

  • 0

When the user clicks on the “Export to Excel” link, the standard “File download” dialog is presented to the user. See here for an example image.

But before exporting the excel file, I want to display an alert popup. But the Save dialog is obscuring the view of the alert popup.

How can I display the popup without it being obscured?

Here is my code…

dsResult = clsObj.getSearchResults_BL(detObj);

if (OrdDifference != null && OrdDifference.Any())
{
   ScriptManager.RegisterClientScriptBlock(this.up, this.GetType(), "export", "alert('.....')", true);
   set(dsResult, strName);
}
else
{
  set(dsResult, strName);
}

private void set(DataSet ds, string strFileName)
{
    ExcelEngine excelEngine = new ExcelEngine();
    IApplication application = excelEngine.Excel;
    application.DefaultVersion = ExcelVersion.Excel2007;
    IWorkbook workbook = application.Workbooks.Create(1);
    IWorksheet sheet = workbook.Worksheets[0];
    try
    {
        sheet.Name = strFileName;
        sheet.ImportDataTable(ds.Tables[0], true, 1, 1, -1, -1);

        ...

        workbook.SaveAs(strFileName, ExcelSaveType.SaveAsXLS, HttpContext.Current.Response, ExcelDownloadType.PromptDialog);

    }
    catch (Exception ex)
    {

    }
}
  • 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-06-11T09:45:32+00:00Added an answer on June 11, 2026 at 9:45 am

    Your problem is here:

    ScriptManager.RegisterClientScriptBlock(this.up, this.GetType(), "export", "alert('.....')", true);
    set(dsResult, strName);
    

    Because the set method in your program is writing to the Response Stream the call to ScriptManager.RegisterClientScriptBlock ends up doing nothing.

    You need to do this on two steps:

    if (OrdDifference != null && OrdDifference.Any())
    {
       //Just do this, nothing more.
       ScriptManager.RegisterClientScriptBlock(this.up, this.GetType(), "export", "alertUser('Some Message Here')", true);
    
    }
    

    Now define the alertUser function in Javascript:

    function alertUser(message)
    {
        alert(message);
        window.location='AccepServiceOrder.aspx?o=Export';
    }
    

    Now on Page_Load check for the o parameter in the query string

    protected void Page_Load(object sender, EventArgs e)
    {
         if(Request.QueryString["o"]!=null)
         { 
            dsResult = clsObj.getSearchResults_BL(detObj);
             set(dsResult, strName);
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Internet explorer used to prompt a user to download an excel file after doing
When a user clicks a table row, I use jQuery to select the link
Use case: user clicks the link on a webpage - boom! load of files
I'm wondering how can I export an r dataframe to excel format file, with
In my application i have to export the excel file which I have achieved
So, in my application the user can export their work to excel. It works
Trying to detect when a user clicks Cancel but the $_POST on using var_export($_POST)
When user clicks hyperlink on my ASP.NET page, I want a new browser to
When user clicks on select box , I want to hide the options menu
When the user clicks on a button, a new ListFragment is displayed. This fragment

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.