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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:34:24+00:00 2026-06-15T22:34:24+00:00

I am generating a Word document with aspose and I would like to show

  • 0

I am generating a Word document with aspose and I would like to show some kind of preview to the user before they decide to save the document. I have a view where users can enter their info:

@model WordAutomation.Models.Document

@{
    ViewBag.Title = "Document";
}

<h2>Document</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Document</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ClientTitle)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ClientTitle)
            @Html.ValidationMessageFor(model => model.ClientTitle)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ClientFullName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ClientFullName)
            @Html.ValidationMessageFor(model => model.ClientFullName)
        </div>      

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Preview", "Preview")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

Now I have the controller for preview:

  public ActionResult Preview()
        {
            return View();
        }

When the user clicks on preview I want to generate the Word document (that part is already done) and display it as a popup on the screen for the user.

Exactly what I need is how to display image on the screen, once I’ll enter the preview controller. Is that possible somehow?

  • 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-15T22:34:25+00:00Added an answer on June 15, 2026 at 10:34 pm

    You could use jquery ui dialog to create a modal and use it something like this. Do not use popup of Access http://ui.jquery.com to download the library and reference on your application.

    At your view, you can add this code to create a dialog modal and load it from the server:

    <script type="text/javascript">
        $(function () {
            $('#previewDocumentDialog').dialog({
                autoOpen: false,
                resizable: false,
                title: 'Preview',
                modal: true,
                width: 400,
                height: 500,
                open: function(event, ui) {
                    //Load the PreviewWordDocument action which will return a partial view called _PreviewWordDocument
                    $(this).load("@Url.Action("PreviewWordDocument")"); //add parameters if necessary
                },
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                }
            });
    
            // an event click for you preview link to open the dialog
            $('#previewLink').click(function () {
                $('#previewDocumentDialog').dialog('open');
            });
        });
    </script>
    

    Create a Div and your link preview, add an id to create/open an dialog of jquery ui

    <div id="previewDocumentDialog" title="Preview" style="overflow: hidden;">
    
    <div>
        @Html.ActionLink("Preview", "Preview", null, new { id = "previewLink" })
    </div>
    

    On your controller, you need to have a action to return this PartialView

    public ActionResult PreviewWordDocument(/*add parameters if necessary*/) {  
        var model = "path of your word image";  
        return PartialView("_PreviewWordDocument", model);
    }
    

    You can type your partialView with the image path on a string

    @model string
    
    <img src="@model" style="width:400;height:500px;" />
    

    And remember to do not use popup window of browser.

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

Sidebar

Related Questions

I am programmatically generating an Office Open XML document (Word 2007 format), and would
When generating VS2010 targets with CMake, I would like the /LTCG flag turned on
I am generating a Word document using the OpenXml SDK 2.0 and everything in
I need a way of generating a word document (from a template or something)
I am programmly generating new paragraphs in Word document via Open XML SDK 2.0.
I would like to ideally set up a user interface for designing emails that
I'm using openxml to create Word DOCX files. I'd like to save these documents
I'm generating a word document with PHP (HTML with ms-word header), is there a
I'm currently working with cakephp and I am generating a word document. My problem
I'm currently creating a Word document by generating HTML and changing the header information

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.