如何在同一页面的预览模式弹出窗口中打开所选的pdf文件

时间:2019-04-23 11:35:00

标签: javascript jquery asp.net modal-dialog

我有一个简单的asp.net表单,其中提供了选择PDF文件的选项。下面是一个链接按钮,该链接必须在弹出窗口中显示上面选择的PDF文件,并在弹出窗口中显示一个链接按钮。

我尝试了模式弹出式jQuery,它实际上会打开服务器中存在的文件,即在引导程序上可用的文件。

    <div class="Upload File">
        <input type="button" id="BtnFileManuscript" class="Button-Upload" value="Select Manuscript file (*.PDF)" tabindex="1" />
        <span id="spnFileNameManuscript"></span>
        <input type="file" id="fileManuScript" name="fileManuScript" accept=".pdf" style="display: none;" />
        <input type="hidden" id="fileNameManuscript" name="fileNameManuscript" />
    </div>
    <div class="Upload">
        <asp:TextBox runat="server" ID="TxtTotalPages" Width="340" MaxLength="4" onkeypress="return IsNumber(event)" PlaceHolder="Total Number of Pages" TabIndex="2" />
        <asp:RequiredFieldValidator runat="server" ID="ReqTotalPages" ControlToValidate="TxtTotalPages" CssClass="Validate" ValidationGroup="Files" ErrorMessage="Please enter the number of pages." />
    </div>
    <div class="Upload">
        <asp:TextBox runat="server" ID="TxtTotalBlackWhite" Width="340" MaxLength="4" onkeypress="return IsNumber(event)" PlaceHolder="Total Black & White Pages" TabIndex="3" />
    </div>
    <div class="Upload">
        <asp:TextBox runat="server" ID="TxtTotalColor" Width="340" MaxLength="4" onkeypress="return IsNumber(event)" PlaceHolder="Total Color Pages" TabIndex="4" />
        <asp:Label runat="server" ID="LblErrorPages" Visible="false" CssClass="Validate" Text="Please enter either Number of Black & White pages or Number of Color pages" />
    </div>
    <div class="Upload">
        <asp:TextBox runat="server" ID="TxtColorPages" Width="340" MaxLength="250" PlaceHolder="Color Page Numbers" TabIndex="5" />
        <asp:RegularExpressionValidator runat="server" ID="RegColorPages" ControlToValidate="TxtColorPages" CssClass="Validate" ValidationGroup="Files" ErrorMessage="Please enter the Color Page Numbers in (1 - 8, 19 - 20) format" ValidationExpression="(\d)+([\,[\s\-]?\d?)+" />
        <asp:Label runat="server" ID="LblColorPages" Visible="false" CssClass="Validate" Text="Please enter the Color Page Numbers in (1 - 8, 19 - 20) format" />
    </div>
    <div class="Upload File">
        <input type="button" id="BtnFileCover" class="Button-Upload" value="Select Cover file (*.PDF)" />
        <span id="spnFileNameCoverPage"></span>
        <input type="file" id="fileCover" name="fileCover" accept=".pdf" style="display: none;" />
    </div>
    <div class="Upload File">
        <input type="button" id="BtnFileCoverImage" class="Button-Upload" value="Select Cover Image file (*.png)" />
        <span id="spnFileNameCoverImage"></span>
        <input type="file" id="FileCoverImage" name="FileCoverImage" accept=".png" style="display: none;" />
    </div>
    <div class="Upload File">
        <asp:LinkButton runat="server" ID="LnkPreview" Text="Preview & Approve" TabIndex="8" />
    </div>

我想用链接按钮打开在fileManuScript中选择的文件的弹出预览,该按钮将控件发送到服务器端进行批准和保存。

0 个答案:

没有答案