<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Samples.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Select.Pdf for .NET - Convert Current Web Page to Pdf - MVC ASPX</title>
    <meta name="description" content="Select.Pdf Convert from Url to Pdf Sample for MVC C#. Pdf Library for .NET with full sample code in C# and VB.NET." itemprop="description">
    <meta name="keywords" content="convert from url to pdf, pdf library, sample code, html to pdf, pdf converter" itemprop="keywords">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
<%using (Html.BeginForm("Convert", "CurrentWebPageToPdf", FormMethod.Post)) {%>
        <article class="post type-post status-publish format-standard hentry">
            <header class="entry-header">
                <h1 class="entry-title">Select.Pdf for .NET - Convert Current Web Page to Pdf - Mvc ASPX</h1>
            </header>
            <!-- .entry-header -->

            <div class="entry-content">
                <p>
                    This sample shows how to use SelectPdf Html to Pdf Converter to convert the current web page to pdf, 
                    preserving the values entered in the page controls before hitting the 'Convert' button.
                </p>
                <p>
                    Url:<br />
                    <input type="text" value="<%= (ViewData["SampleText"] != null ? ViewData["SampleText"].ToString() : String.Empty) %>" name="TxtSampleText" style="width: 90%"/>
                </p>
                <div class="col2">
                    Pdf Page Size:<br />
                    <select name="DropDownList1">
                        <option value="Value1" <%= (ViewData["DropDownList1"] != null && ViewData["DropDownList1"].ToString() == "Value1" ? "selected" : String.Empty) %>>Value1</option>
                        <option value="Value2" <%= (ViewData["DropDownList1"] != null && ViewData["DropDownList1"].ToString() == "Value2" ? "selected" : String.Empty) %>>Value2</option>
                        <option value="Value3" <%= (ViewData["DropDownList1"] != null && ViewData["DropDownList1"].ToString() == "Value3" ? "selected" : String.Empty) %>>Value3</option>
                        <option value="Value4" <%= (ViewData["DropDownList1"] != null && ViewData["DropDownList1"].ToString() == "Value4" ? "selected" : String.Empty) %>>Value4</option>
                    </select><br />
                    <br />
                    Sample check box:<br />
                    <input type="checkbox" name="ChkSampleCheckbox" <%= (ViewData["SampleCheckbox"] != null && ViewData["SampleCheckbox"].ToString() != "false" ? "checked" : String.Empty) %> />
                    <br />
                </div>
                <div class="col2">
                    Sample text field:<br />
                    <input name="TxtSampleText2" type="text" style="width: 50px" value="<%= (ViewData["SampleText2"] != null ? ViewData["SampleText2"].ToString() : String.Empty) %>" /> px<br />
                    <br />
                    Sample text field:<br />
                    <input name="TxtSampleText3" type="text" style="width: 50px" value="<%= (ViewData["SampleText3"] != null ? ViewData["SampleText3"].ToString() : String.Empty) %>" /> px<br />
                    <br />

                </div>
                <div class="col-clear"></div>
                <p>
    <p>
        Rendering Engine:<br />
        <%= Html.DropDownList("DdlRenderingEngine", new SelectList(new[] {
            new SelectListItem { Text = "WebKit", Value = "WebKit" },
            new SelectListItem { Text = "WebKit Restricted", Value = "WebKitRestricted" },
            new SelectListItem { Text = "Chromium", Value = "Chromium" }
        }, "Value", "Text", "Chromium")) %>
    </p>
                    <input type="submit" name="BtnConvert" value="Create PDF" class="mybutton"/>
                </p>
            </div>
            <!-- .entry-content -->
        </article>
<%} %>  

</asp:Content>

