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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:01:43+00:00 2026-05-31T19:01:43+00:00

I have created an application server side that will create a pdf of a

  • 0

I have created an application server side that will create a pdf of a report when requested. Then the link of that report can then be sent back to the client.

My question is how do I hook this up to a button click event in my asp.net mvc website. So the scenario is:

  1. User fills in a few boxes.
  2. Clicks the generate report button.
  3. A little loading feedback indicator is shown.
  4. A request is sent to the server, the server then generates the PDF report and sends back a url link to the pdf that is being hosted on the server.
  5. The pdf will then be shown in the users browser (maybe in a new window).

Is this possible and is there any examples around that show how to do it?

Thanks in advance

  • 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-31T19:01:45+00:00Added an answer on May 31, 2026 at 7:01 pm

    I’ve done something similar.
    When the user clicks the button it send an ajax request to the server passing some data:

    $.ajax({
        type: 'POST',
        dataType: 'json',
        url: '<%=Url.Action("GenerateReport", "MyController")%>',
        data: { Param1: $('#Param1').val() , Param2: $('#Param2').val() },
        beforeSend: function(xhr) {
             $.blockUI({ message: '<h1> printing ...</h1>', css: { border: 'none', padding: '15px', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .5, color: '#fff'} });
        },
        success: function(result) {
            if (result.Success) {
               FetchPdfDocument('<%=Url.Action("GetPdfReport", "MyController", New With {.id = "/"})%>' + result.Guid);
        }
        else {
            alert("Problems!");
        }
        },
        complete: function() {
           $.unblockUI();
        },
        error: function(req, status, error) {
           alert(error);
        }
    });
    

    The controller writes the document on the disk and sends back a guid which is the name of the PDF document.

    This is the other bit of javascript which opens the file creating an IFRAME:

    function FetchPdfDocument(UrlToPdf)
         {
         $('#ifPdfReport').remove();
         $(document.body).append('<IFRAME id="ifPdfReport" style="display:none;">');
         $('iframe#ifPdfReport').attr('src', UrlToPdf);
         // $('#ifPdfReport').load(function () { });                    
         }
    

    I’ve used jQuery BlockUI as loading feedback indicator.
    Hope it helps.

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

Sidebar

Related Questions

I want to create an application which will have a client and server components.
I am building a client side application that will use a SQL Server back
I need to create an application that will use Flex on the client side
I have created a C# application that I want to split into server and
I have a C# Windows Forms application, whose prototype was created on SQL Server
I have created an application that writes some data to the root folder of
I have created an application that runs in the taskbar. When a user clicks
I have created an application that has a toolbar, menubar and content area. I
Do we really need a server side architecture to create a RIA application? My
I'm trying to create a WP7 application that will upload an image to my

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.