Send Html as parameter from javascript to asp.net mvc controller

sGermosen

I need to pass some HTML markup to the controller (please see my detalle variable), using jquery, in the action is that I have the problem when I try to send the detalle, it said that is not found, somebody can help me?

           $('#BtnPrint').click(function() {

                var detalle = "<br><br>";

                detalle += " Yo: <b>" + '@Model.DoctorText' + "</b>";
                if ('@Model.Exequartur' != "") {
                    detalle += ", exequatur: <b>" + '@Model.Exequartur' + "</b>    <br>";
                }

                detalle += "   certifico haber examinado a: <b>" + '@Model.PatientName' + "</b> <br>";
                @*if (@Model.ide != "")
                {
                    detalle += " cedula: <b>" + txtcedula.Text + "</b>    <br>";
                }*@

                detalle += " quien presenta: <b>" + '@Model.Affections' + "</b>    <br>";
                detalle += " por lo que recomiendo: <b>" + '@Model.Recomendations' + "</b>    <br>";
                detalle += "<br> dado en: <b>" + ' @Model.Place' + "</b>, " + '@Model.MedicalCertificateDate' +
                    "    <br>";
                detalle += "<br><br><br><br>  ";
                $('#myVar').val(detalle); 



            var win = window.open(
                "@Url.Action("DetailsPrint", "Reports", new {area = "Configurations", id = @Model.Patient.Person.AuthorId, body = detalle, description = "Certificado Medico"})" )  ;

                ////  var win = window.open('http://stackoverflow.com/', '_blank');
                if (win) {
                    //Browser has allowed it to be opened
                    win.focus();
                } else {
                    //Browser has blocked it
                    alert("Porfavor, debes permitir que se abran las ventanas emergentes o el reporte no va a salir :'( ");
                }

            });
sgrysoft

I recomend you to use specific report for each case, you can do it dinamically, but, just one for each type of it, because all of them, have diferent sizes

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to send string list from controller to javascript (present in view) in asp.net mvc

From Dev

Send string from View to Controller ASP.Net mvc

From Dev

Pass Html String from Controller to View ASP.Net MVC

From Dev

Repository Parameter in controller asp.net mvc

From Dev

Calling the controller correctly from JavaScript - ASP.NET MVC

From Dev

Calling ASP.NET MVC 4 Controller from Javascript

From Dev

Send parameter from html to method in controller

From Dev

I want send data and file in javascript to controller (but how)(Mvc asp.net)

From Dev

ASP.NET Core MVC : passing one parameter (from ViewModel) from view to controller

From Dev

How to send data from view to controller with drop down list asp.net core 5 MVC

From Dev

How to send ASCII codes stream from an ASP.NET MVC controller

From Dev

How to send two arrays as POST request parameters from AJAX to MVC controller (ASP .NET Core 3.1 razor)?

From Dev

Send data from textbox with ajax to asp.net mvc 5 controller

From Dev

How to send data from a bootstrap menu item to an ASP.NET MVC controller

From Dev

ASP.NET MVC send List<Foo> collection from my View to a Controller

From Dev

Unable to send the data from view to controller Asp.net MVC using Jquery

From Dev

How to pass parameter using JavaScript to MVC Controller - ASP.NET 7

From Dev

How can i send a object from Asp.net MVC controller to Asp.Net WebForm without using Session?

From Dev

Return JSON from any ASP.NET MVC controller action based on a parameter

From Dev

ASP.NET Core MVC controller receives null for input parameter from ajax call

From Dev

How could I pass multiple collections to View as parameter from Controller in ASP.NET MVC?

From Dev

How do I deserialize from JSON to an abstract parameter on an ASP.NET MVC 5 controller

From Dev

ASP.NET MVC How to pass JSON object from View to Controller as Parameter

From Dev

ASP.NET Core MVC: Passing one parameter from a view to a controller

From Dev

How to: (a) send JSON data from the browser to the controller; and (b) send the transformed data to SQL Server within ASP.NET MVC?

From Dev

Unable to send file value to controller in asp.net mvc with js

From Dev

Send modified table to controller in ASP.NET MVC?

From Dev

How to send item through ActionLink to ASP.NET MVC controller?

From Dev

ASP.NET MVC form does not send data to controller

Related Related

  1. 1

    how to send string list from controller to javascript (present in view) in asp.net mvc

  2. 2

    Send string from View to Controller ASP.Net mvc

  3. 3

    Pass Html String from Controller to View ASP.Net MVC

  4. 4

    Repository Parameter in controller asp.net mvc

  5. 5

    Calling the controller correctly from JavaScript - ASP.NET MVC

  6. 6

    Calling ASP.NET MVC 4 Controller from Javascript

  7. 7

    Send parameter from html to method in controller

  8. 8

    I want send data and file in javascript to controller (but how)(Mvc asp.net)

  9. 9

    ASP.NET Core MVC : passing one parameter (from ViewModel) from view to controller

  10. 10

    How to send data from view to controller with drop down list asp.net core 5 MVC

  11. 11

    How to send ASCII codes stream from an ASP.NET MVC controller

  12. 12

    How to send two arrays as POST request parameters from AJAX to MVC controller (ASP .NET Core 3.1 razor)?

  13. 13

    Send data from textbox with ajax to asp.net mvc 5 controller

  14. 14

    How to send data from a bootstrap menu item to an ASP.NET MVC controller

  15. 15

    ASP.NET MVC send List<Foo> collection from my View to a Controller

  16. 16

    Unable to send the data from view to controller Asp.net MVC using Jquery

  17. 17

    How to pass parameter using JavaScript to MVC Controller - ASP.NET 7

  18. 18

    How can i send a object from Asp.net MVC controller to Asp.Net WebForm without using Session?

  19. 19

    Return JSON from any ASP.NET MVC controller action based on a parameter

  20. 20

    ASP.NET Core MVC controller receives null for input parameter from ajax call

  21. 21

    How could I pass multiple collections to View as parameter from Controller in ASP.NET MVC?

  22. 22

    How do I deserialize from JSON to an abstract parameter on an ASP.NET MVC 5 controller

  23. 23

    ASP.NET MVC How to pass JSON object from View to Controller as Parameter

  24. 24

    ASP.NET Core MVC: Passing one parameter from a view to a controller

  25. 25

    How to: (a) send JSON data from the browser to the controller; and (b) send the transformed data to SQL Server within ASP.NET MVC?

  26. 26

    Unable to send file value to controller in asp.net mvc with js

  27. 27

    Send modified table to controller in ASP.NET MVC?

  28. 28

    How to send item through ActionLink to ASP.NET MVC controller?

  29. 29

    ASP.NET MVC form does not send data to controller

HotTag

Archive