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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:58:04+00:00 2026-06-11T14:58:04+00:00

my application is MVC3 (ASPX views). I have a form, in the Edit view

  • 0

my application is MVC3 (ASPX views). I have a form, in the Edit view I have save button, that saves the form and return to the index page, and another button to print PDF from another ActionResult in the same controller as Edit; it there a way to save and print the PDF from one button?
Here is my script for edit view:

 public ActionResult EditCTAH(long learnerID = 0, long caseListID = 0)
    {

        ViewBag.caseListID = (long)Session["_CTA_CaseListId"];
        try
        {
            CTAHFormEdit ctform = _learnerscaseListsSvc.GetCTAHForm(learnerID, caseListID);
            return View(ctform);
        }
        catch
        {
            return null;
        }
    }

    [HttpPost]
    public ActionResult EditCATH(CTAHFormEdit ctform)
    {
        if (ModelState.IsValid)
        {
            _learnerscaseListsSvc.EditCTAHForm(ctform);
            long courseId = (long)Session["_CTA_CourseId"];
            long caseId = (long)Session["_CTA_CaseId"];
            long caselistId = (long)Session["_CTA_CaseListId"];
            return RedirectToAction("Index", new { courseId = courseId, caseId = caseId, caselistId = caselistId });
        }

        return View(ctform);
    }

and here is the script for printing the PDF:

   public ActionResult EvaluationCATH_PDF(long learnerID = 0, long caseListID = 0)
        {
            try
            {
.....
    pdfStamper.Close();
                byte[] byteInfo = workStream.ToArray();
                SendPdfToBrowser(byteInfo, cth.Learner_ID, cth.StudyCase_ID);
                return null;
            }
            catch
            {
                return null;
            }
        }

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-06-11T14:58:05+00:00Added an answer on June 11, 2026 at 2:58 pm

    If you want to get the PDF on the Save of your edit action, you may redirect to an action method which returns the PDF to browser

    [HttpPost]
    public ActionResult EditCATH(CTAHFormEdit ctform)
    {
        if (ModelState.IsValid)
        {
         //Saved succesfully, lets show the pdf in browser.
          return RedirectToAction("Print",new { id=someIdValue});
        }
        return View(ctform);
    }
    public ActionResult Print(string id)
    {
       byte[] pdfByteArray=GetByteArrayFromPassedID(id);
       return File(pdfByteArray,"application/pdf","somefriendlyname.pdf");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my application is MVC3 using ASPX views. I have two pages, create and Edit,
In an MVC3 application I have a view rendering two Ajax partial views: a
We have a MVC3 application that we have created many small actions and views
I'm developing an ASP MVC3 application and I have some views that are related
In my MVC3 application, I have a queries class specific to each controller that
I have an ASP.NET MVC3 application that I have built and it has two
MVC3 vb.net Application using built in session management. I have an mvc3 application that
I have an MVC3 application that has a custom HandleErrorAttribute so that I can
I am developing an MVC3 application using Visual Studio 2010. I have an aspx
I have an MVC3 application that I am implementing pjax into . Everything is

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.