8112 1
How I connect chart.js to database in ASP.NET web form mvc in visual studio 2015 ?

 I have make a chart.js in my website to display chart showing demand of a fruit over date range using this script below :

 

<div class="chart-wrapper" style="height:200px;margin-top:40px;">
    <canvas id="main-chart" class="chart" height="100"></canvas>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js">
</script>
<script>
    var ctx = document.getElementById("main-chart").getContext('2d');
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["M", "T", "W", "T", "F", "S", "S", "M"],
            datasets: [{
                label: 'Traffic',
                data: [0, 50, 100, 150, 200, 250, 300, 350],
                backgroundColor: [
                    'rgba(255, 99, 132, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(255, 206, 86, 0.2)',
                    'rgba(75, 192, 192, 0.2)',
                    'rgba(153, 102, 255, 0.2)',
                    'rgba(255, 159, 64, 0.2)'
                ],
                borderColor: [
                    'rgba(255,99,132,1)',
                    'rgba(54, 162, 235, 1)',
                    'rgba(255, 206, 86, 1)',
                    'rgba(75, 192, 192, 1)',
                    'rgba(153, 102, 255, 1)',
                    'rgba(255, 159, 64, 1)'
                ],
                borderWidth: 1
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: true
                    }
                }]
            }
        }
    });
</script>

...

Type
Question
8068 0
Form Submit in ASP.NET Core MVC using Tag Helpers
In this article, I have explained how to submit form in ASP.NET Core MVC using tag helpers and get data in controller to save it in database.
Type
Article
8040 2
This request has been blocked because sensitive information could be disclosed...ASP.NET JSON Return error?

Hi, I am trying to load data in Asp.NET MVC using JsonResult as return type to load rows in jQuery datatable server-side processing, but I am getting this error

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.]

So why I am getting this issue and how can I resolve it?

Here is my partial C# code

...
Type
Question
7983 2
MaxJsonLength error during serialization or deserialization using the JSON JavaScriptSerializer in ASP.NET MVC

When I am trying to return JSON data to my jQuery Datatable(Ajax based), It is working in some cases, but it is throwing below error in some cases

...
Type
Question

7973 1
How to calculate distance between two geolocation?

I am calculating distance between two Latitude and long
one is the current location of the user and another from the database, I want here if the lat-long distance is between 4km then show data

how can I do it using C#?

...
Type
Question
7889 2
How do I update .edmx file to get new columns in Visual Studio 2017 (ASP.NET MVC)?

I was trying to update my .edmx (ADO.NET) file to get updated or you can say newly added columns, but I wasn't able to get it, what is the proper way to update  or refresh the model to get new database table columns, when the database changes.

I do not want the process of deleting the complete Models and again adding them from database.

...
Type
Question
7880 0
Model binding and Custom Model binding in MVC
In this article,first, I will explain about Model binding in ASP.NET MVC and then I will explain to create custom model binder in mvc C#.
Type
Article
7858 1
How to upload image on cloudinary in ASP.NET MVC?

I have just started using Cloudinary to upload images for my client's project there & I was trying to upload an image using explanation provided here https://cloudinary.com/documentation/dotnet_image_upload but it's not working for me, can you explain a complete example of this? Or any link of tutorial will also help, thanks.

...
Type
Question
7659 0
Using Chart in ASP.NET (Pie chart in ASP.NET)
In this article, I have explained and provided example to create dynamic pie chart in asp.net using database data and asp.net chart control.
Type
Article

Page 13 of 31