Click here to Skip to main content
15,914,452 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
indian14317-Jun-16 9:15
indian14317-Jun-16 9:15 
GeneralRe: @Url is saying "the name url doesn't exist in the current context" ASP.MVC 4 Pin
jkirkerx19-Jun-16 7:07
professionaljkirkerx19-Jun-16 7:07 
Question.NET Oracle.DataAccess.Client Pin
Karan_TN14-Jun-16 3:52
Karan_TN14-Jun-16 3:52 
AnswerRe: .NET Oracle.DataAccess.Client Pin
John C Rayan14-Jun-16 4:22
professionalJohn C Rayan14-Jun-16 4:22 
Question.net Pin
Member 1257929012-Jun-16 7:59
Member 1257929012-Jun-16 7:59 
AnswerRe: .net Pin
Richard MacCutchan12-Jun-16 23:00
mveRichard MacCutchan12-Jun-16 23:00 
AnswerRe: .net Pin
F-ES Sitecore12-Jun-16 23:32
professionalF-ES Sitecore12-Jun-16 23:32 
AnswerRe: .net Pin
Richard Deeming13-Jun-16 2:05
mveRichard Deeming13-Jun-16 2:05 
GeneralRe: .net Pin
ZurdoDev15-Jun-16 9:40
professionalZurdoDev15-Jun-16 9:40 
AnswerRe: .net Pin
John C Rayan14-Jun-16 4:24
professionalJohn C Rayan14-Jun-16 4:24 
Question.net Pin
Member 1257929012-Jun-16 7:57
Member 1257929012-Jun-16 7:57 
QuestionWell after the last 5 days, I feel unchained from the Microsoft ball now! MVC with Bower, NPM and Gulp and Docker Pin
jkirkerx10-Jun-16 7:35
professionaljkirkerx10-Jun-16 7:35 
PraiseRe: Well after the last 5 days, I feel unchained from the Microsoft ball now! MVC with Bower, NPM and Gulp and Docker Pin
John C Rayan14-Jun-16 4:51
professionalJohn C Rayan14-Jun-16 4:51 
GeneralI went ahead and upgraded to Windows 10 and VS2015 Pin
jkirkerx15-Jun-16 7:42
professionaljkirkerx15-Jun-16 7:42 
GeneralRe: I went ahead and upgraded to Windows 10 and VS2015 Pin
John C Rayan15-Jun-16 22:08
professionalJohn C Rayan15-Jun-16 22:08 
GeneralRe: I went ahead and upgraded to Windows 10 and VS2015 Pin
jkirkerx16-Jun-16 7:14
professionaljkirkerx16-Jun-16 7:14 
GeneralRe: I went ahead and upgraded to Windows 10 and VS2015 Pin
John C Rayan17-Jun-16 2:14
professionalJohn C Rayan17-Jun-16 2:14 
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");
}

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.