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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:32:25+00:00 2026-05-28T14:32:25+00:00

I have an HTML form that calls an ASP.NET page when a button is

  • 0

I have an HTML form that calls an ASP.NET page when a button is pressed using JavaScript’s window.location. The ASP.NET page runs a process and prompts the user to save the results of the process to a text file on the user’s computer.

Because the ouput of the ASP.NET page is a text file, the user never actually navigates away from the HTML form–that is the behavior I want. However, the process involved in generating the text file can take a minute or so. Hence, I’d like my HTML form to display a “Loading” message while the page is running and remove the message when the page is done running.

How can my HTML form know the state of the page it calls? In other words, how can I know when to remove the “Loading” message from the HTML form?

I ended up using a callback with an ASPX WebMethod to solve the issue. Since an ASPX WebMethod cannot save a text file to the browser, I write the file to disk and then return the URL of the file, prompting the user to save it.

  • 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-28T14:32:26+00:00Added an answer on May 28, 2026 at 2:32 pm

    At a high level, you need to make an AJAX call from your JavaScript to some kind of endpoint on the server. Sounds like you’re partway there already, but instead of calling the page itself (I’m guessing you’re doing a simulated postback from JavaScript), you’d need to call a something that knows how to return a value to your calling JavaScript. An ASP.NET WebMethod is one approach; you could also create a web service. The WebMethod approach would be closer to what you’re doing now.

    The WebMethod would then return a JSON or XML message containing a success/failure message.

    In your JavaScript, then, the flow goes like this:

    • User clicks link
    • Begin some kind of busy animation
    • Send AJAX request to the WebMethod on the server, along with a callback function that will be invoked when the server returns a result
    • WebMethod processes the form
    • Server sends a message back to the browser with a “success!” message
    • Original AJAX function invokes the callback, which would stop the busy animation and display a success message to your user

    If you include more details about the technologies you’re using, I could be more specific.

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

Sidebar

Related Questions

I have an asp.net form that contains some html, 2 controls a calendar from
I have a html form that posts to a new page on submit. If
This is probably a basic html/css question... I have a simple one-button form that
I have a form on an HTML page with multiple submit buttons that perform
I have a site that has a simple HTML button in a form. All
I have an ASP.NET MVC 2 form that is working perfectly, doing client side
I have an ASP.NET web form. This web form has an event handler that
I have got an ASP page that does some back-end processing. It calls a
I have an ASP.NET MVC project with a form. In the Action method that
I have a simple ASP.NET page that uses the VLC media player to play

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.