Click here to Skip to main content
15,892,059 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionvisitors tag printing. Pin
forest4ever10-Jun-16 0:28
forest4ever10-Jun-16 0:28 
AnswerRe: visitors tag printing. Pin
aarif moh shaikh12-Jun-16 19:48
professionalaarif moh shaikh12-Jun-16 19:48 
GeneralRe: visitors tag printing. Pin
forest4ever12-Jun-16 23:30
forest4ever12-Jun-16 23:30 
QuestionDynamically change grid.mvc in partial view in MVC? Pin
dshilpa8-Jun-16 19:43
dshilpa8-Jun-16 19:43 
AnswerRe: Dynamically change grid.mvc in partial view in MVC? Pin
Richard MacCutchan8-Jun-16 20:59
mveRichard MacCutchan8-Jun-16 20:59 
GeneralRe: Dynamically change grid.mvc in partial view in MVC? Pin
dshilpa8-Jun-16 22:30
dshilpa8-Jun-16 22:30 
AnswerRe: Dynamically change grid.mvc in partial view in MVC? Pin
John C Rayan8-Jun-16 22:55
professionalJohn C Rayan8-Jun-16 22:55 
QuestionPost ifram embedded PDF editable document to ASP.Net MVC Post Action Pin
Asjad ali kash8-Jun-16 1:01
Asjad ali kash8-Jun-16 1:01 
C#
Need Help about PDF document opened in iframe using ASP.Net MVC

My requirement is to provide a facility in my application to open a PDF document in editable format, user will edit and sign the PDF fields and submit it back. I load the document in iFrame and now i want to get all the fields in the PDF form on submit click. Can u please help me

My VIEW code is as below

HTML
<form id="frmPDF" enctype="multipart/form-data" method="post" action="@Url.Action("SavePDF", "Home")" target="_blank">
<iframe type='application/pdf' name='PDFObj' id='PDFObj' src="@Url.Action("GetPDF", "Home")" style="width: 100%; height: 625px;" ></iframe>
<input type="submit" value="Submit PDF" />
<input type="hidden" name="hid" value="safd" /> 
</form>

<script>
$(document).ready(function() {
    $('form').on("submit", function (event) {
        var form = $(this);
        var iframe = document.getElementById('PDFObj');
        var iframeDocument = [iframe.contentDocument || iframe.contentWindow.document];

        var pluginData = iframeDocument;            
        $(form).append('<input type="file" name="PDFInput" id="PDFInput" value="' + pluginData + '" style="visibility:hidden"/>');
        form.submit();
    });
});
</script>


And my Controller Code is:
C#
public ActionResult GetPDF()
{
    return File("~/Content/newDocument.pdf", "application/pdf");
}

[HttpPost]
public ActionResult SavePDF()
{
    var hid = Request["hid"];
    HttpPostedFileBase file = Request.Files[0];
    if (file != null && file.ContentLength > 0)
    {
        var fileName = Path.GetFileName(file.FileName);
        var path = Path.Combine(Server.MapPath("~/App_Data"), fileName);
        file.SaveAs(path);
    }
    return View("Index");
}

Questionsorting of a image column Pin
mrakshay12127-Jun-16 23:56
mrakshay12127-Jun-16 23:56 
QuestionTrying to create database using Code First Approach Pin
indian1437-Jun-16 16:20
indian1437-Jun-16 16:20 
Rant[REPOST] Trying to create database using Code First Approach Pin
Richard Deeming8-Jun-16 1:41
mveRichard Deeming8-Jun-16 1:41 
AnswerRe: Trying to create database using Code First Approach Pin
jkirkerx10-Jun-16 7:56
professionaljkirkerx10-Jun-16 7:56 
QuestionWhat is Diffrent between hash table and dictionary Pin
jitendra jayswal7-Jun-16 1:26
jitendra jayswal7-Jun-16 1:26 
SuggestionRe: What is Diffrent between hash table and dictionary Pin
Richard MacCutchan7-Jun-16 3:23
mveRichard MacCutchan7-Jun-16 3:23 
QuestionUsing Webgrease, Best Practices, vs Gulp and Bower Pin
jkirkerx5-Jun-16 12:26
professionaljkirkerx5-Jun-16 12:26 
AnswerI decided to dump Webgrease and the bundle, and use Gulp, bower, git and node to automate the task. Pin
jkirkerx6-Jun-16 9:19
professionaljkirkerx6-Jun-16 9:19 
QuestionGoogle map with multiple marked location Pin
Member 118050633-Jun-16 3:38
Member 118050633-Jun-16 3:38 
AnswerRe: Google map with multiple marked location Pin
ZurdoDev3-Jun-16 4:40
professionalZurdoDev3-Jun-16 4:40 
QuestionHttpWebRequest authentication problem Pin
candogu2-Jun-16 3:07
candogu2-Jun-16 3:07 
AnswerRe: HttpWebRequest authentication problem Pin
ZurdoDev2-Jun-16 3:14
professionalZurdoDev2-Jun-16 3:14 
GeneralRe: HttpWebRequest authentication problem Pin
candogu2-Jun-16 3:16
candogu2-Jun-16 3:16 
GeneralRe: HttpWebRequest authentication problem Pin
ZurdoDev2-Jun-16 3:19
professionalZurdoDev2-Jun-16 3:19 
AnswerRe: HttpWebRequest authentication problem Pin
John C Rayan2-Jun-16 3:18
professionalJohn C Rayan2-Jun-16 3:18 
AnswerRe: HttpWebRequest authentication problem Pin
F-ES Sitecore2-Jun-16 4:24
professionalF-ES Sitecore2-Jun-16 4:24 
QuestionAsp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
jkirkerx1-Jun-16 11:25
professionaljkirkerx1-Jun-16 11:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.