Telerik Forums
UI for ASP.NET MVC Forum
2 answers
135 views

Hi,

 

I am trying to implement same way as ASP.NET Core PDF Export Key Features Demo | Telerik UI for ASP.NET Core

but Its exporting in client side but it's not going to controller. Don't know what mistake I am doing. Is there a way to send the pad to controller and send it to email attachment. Below is my code.


        $("#btnSubmit").on("click", function (e) {
            e.stopPropagation();
            e.preventDefault();
            var sigval = signature.value();
            $('#lblSearchError').text('');
            if (sigval === undefined || sigval === '') {
                $('#lblSearchError').text('*Signature field is required.');
            } else {
                var data = $("#submitForm").serializeArray();
                var obj = { name: 'signature', value: sigval };
                data.push(obj);

                // Convert the DOM element to a drawing using kendo.drawing.drawDOM
                kendo.drawing.drawDOM($("#mainContect"))
                .then(function (group) {
                    // Render the result as a PDF file
                    return kendo.drawing.exportPDF(group, {
                        paperSize: "auto",
                        margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
                    });
                })
                .done(function (data) {
                    // Save the PDF file
                    kendo.saveAs({
                        type: 'POST',
                        dataURI: data,
                        fileName: "Provider.pdf",
                        proxyURL: '@Url.Action("Submit", "Provider")'
                    });
                });
            }
        });

I tried proxyURL AND URL none of them worked. When I clicked on submit button it's just downloading the pdf file. But it not hitting controller.

and in controller 


        [HttpPost]
        public ActionResult Submit(string contentType, string base64, string fileName)
        {
            //if (!ModelState.IsValid)
            //{
            //    data.Id = 0;
            //    return Json(data, JsonRequestBehavior.AllowGet);
            //}

            //var providerData = portalServices.saveProviderData(data);
            //    return Json(providerData, JsonRequestBehavior.AllowGet);

            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }

Babu
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 23 Jun 2023
1 answer
59 views

I'm trying to use a menu helper in the drawer's Template and it's not working. Is this even possible?  Do you have any examples of using other controls with the helper? All the examples are pretty simple.

 

Ivan Danchev
Telerik team
 answered on 17 Nov 2022
1 answer
73 views
Hi everyone,

Need help, if it could be possible to turn off the slider of the drawer navigation. I mean when mouse is clicked and slide from left to right or right to left while clicking will open/close the drawer respectively. Is there any way I can disable it?  

Ivan Danchev
Telerik team
 answered on 22 Sep 2022
1 answer
254 views

Hi there,

I am using Kendo UI for ASP.NET MVC.

I am interested in using the Drawer as a side menu, but I can't seem to find a way to have it expanded by default when the page loads.  Is this possible?

 

Petar
Telerik team
 answered on 23 Jun 2021
3 answers
476 views

I tried to use fa icons in the drawer but it did not seem to resize / pad (in mini mode) properly. So some of the text was visible.

What am I missing?

Regards

Erwin

Tsvetomir
Telerik team
 answered on 03 Mar 2021
2 answers
201 views

Hi,

how can I toggle the drawer mini mode / expanded mode from within the drawer itself.

The samle code I found has the toggle button in some other control, for example the toolbar.

I would like to have the drawer in mini mode and one item  in the drawer to expand / collapse it.

When I expand the drawer from a handler function for itemClick, it expands but collapses at the end of the handler.

 

Regards

Erwin

erwin
Top achievements
Rank 1
Veteran
Iron
 answered on 07 Jun 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?