mvc data size acception

i have the following codes, and everything is working except the outhtml's size is too big but i do not know how big.
so I added some settings on webconfig but it is till not working.
Can you share with me whatelse I need to do to max the size of accepting data size?
[HttpPost]
        public JsonResult GetAgingReport(string invoicestartandenddate, string receiptstartandenddate, string chargecode)
        {
             
            Domain.Accounting.Report r = new Domain.Accounting.Report();             
            r.invoicestartdate = invoicestartdate;
            r.invoiceendate = invoiceenddate;
            r.receiptstartdate = receiptstartdate;
            r.receiptenddate = receiptenddate;
            r.chargecode = chargecode;
    
            MasterController.ServiceAccounting sa = new MasterController.ServiceAccounting();
            List<Domain.Accounting.Report> agingInDetail= sa.AgingInDetails(r);
            string returnStrInHTML = sa.AgingInDetailsInHTML(agingInDetail);
       
             r.outputHTML = returnStrInHTML;
            return Json(r, JsonRequestBehavior.AllowGet);
        }

Open in new window

  $.ajax({
                url: "/Accounting/GetAgingReport",
                datatype: "text",
                data:
                {
                    'invoicestartandenddate': invoicestartandenddatevalue,
                    'receiptstartandenddate': depositstartandenddatevalue,                   
                    'chargecode': chargecodevalue
                },
                type: "POST",
                success: function (data) {
                    var id = data.outputHTML;
                    alert("Success");
                         
                },
                error: function (error) {
                    alert("Error " + error);

                }
            }); 

Open in new window

 <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1" executionTimeout="100000" maxRequestLength="214748364" />
  </system.web>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483647" />
      </webServices>
    </scripting>
  </system.web.extensions>
  <system.webServer>
     <security>
      <requestFiltering>
        <requestLimits  maxAllowedContentLength="2147483647"  />
      </requestFiltering>
    </security>
  </system.webServer>

Open in new window

LVL 1
ITsolutionWizardAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ITsolutionWizardAuthor Commented:
anyone can help?
ITsolutionWizardAuthor Commented:
any one here ?
Chinmay PatelChief Technology NinjaCommented:
What is the maximum size you are trying to post? any approximation?
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

ITsolutionWizardAuthor Commented:
I don't the size. just tell me what else I need to do on the setting
ITsolutionWizardAuthor Commented:
any helps?
ITsolutionWizardAuthor Commented:
any helps?
Chinmay PatelChief Technology NinjaCommented:
Are you getting any errors when you try to upload the file? If yes, please paste the error content here, you can remove any sensitive information from the error.
ITsolutionWizardAuthor Commented:
not upload it is Json response
Chinmay PatelChief Technology NinjaCommented:
Did you try to debug it on server side? Or it fails before you hit the breakpoint? What do you get in JsonResponse?
ITsolutionWizardAuthor Commented:
all i see object object alert in js.
Chinmay PatelChief Technology NinjaCommented:
But that would mean
The call was successful. If there was an error you would see alert("Error " + error);
                    var id = data.outputHTML;
                    alert("Success");
 

Open in new window


Also you have set the size to 2147483647, any specific reason/calculations behind this number?
Also 214748364 would mean size of 2GB, which I think is way too high for a Report. Maybe you need to tweak this number as well.

As long as you are not getting an error, I suggest you look in to your server side code why it is not able to process the message.
ITsolutionWizardAuthor Commented:
i did review the source code behind.and I actually put the exact same codes on aspx / c# page, and it is working and without any errors regardless of any sizes.
Chinmay PatelChief Technology NinjaCommented:
Did you change the web.config's 2147483647 value to 214748364 or even that was not needed?
ITsolutionWizardAuthor Commented:
I post the web config codes already when i post this question.

 <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1" executionTimeout="100000" maxRequestLength="214748364" />
  </system.web>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483647" />
      </webServices>
    </scripting>
  </system.web.extensions>
  <system.webServer>
     <security>
      <requestFiltering>
        <requestLimits  maxAllowedContentLength="2147483647"  />
      </requestFiltering>
    </security>
  </system.webServer>

Open in new window

Chinmay PatelChief Technology NinjaCommented:
I know you posted web.config, I just wanted to check if you changed the values or not. It seems you did not.

When you run the page and upload a large file, do you see an alert with "Success" in it?

Also can you check what are you getting from the server side method by putting a debugger and watching the value of data in browser console?
success: function (data) {
debugger;
                    var id = data.outputHTML;
                    alert("Success");
                },

Open in new window

ITsolutionWizardAuthor Commented:
I change the number and add debugger there.
The response is no change.
ITsolutionWizardAuthor Commented:
any progress?
Chinmay PatelChief Technology NinjaCommented:
debugger is used on client side script to check if it stops, have you tried debugging the JavaScript using Developer Tools of the browser?

Also do you see any alert message?
ITsolutionWizardAuthor Commented:
hi chinmay, i am not sure you refer to.
Chinmay PatelChief Technology NinjaCommented:
Originally, you posted
  $.ajax({
                url: "/Accounting/GetAgingReport",
                datatype: "text",
                data:
                {
                    'invoicestartandenddate': invoicestartandenddatevalue,
                    'receiptstartandenddate': depositstartandenddatevalue,                   
                    'chargecode': chargecodevalue
                },
                type: "POST",
                success: function (data) {
                    var id = data.outputHTML;
                    alert("Success");
                         
                },
                error: function (error) {
                    alert("Error " + error);

                }
            }); 

Open in new window


I suggested you change it to:
  $.ajax({
                url: "/Accounting/GetAgingReport",
                datatype: "text",
                data:
                {
                    'invoicestartandenddate': invoicestartandenddatevalue,
                    'receiptstartandenddate': depositstartandenddatevalue,                   
                    'chargecode': chargecodevalue
                },
                type: "POST",
                success: function (data) {
debugger;
                    var id = data.outputHTML;
                    alert("Success");
                         
                },
                error: function (error) {
                    alert("Error " + error);

                }
            }); 

Open in new window


the "deubbger;" keyword will stop executing the code and let you see what is happening on the client side. As you said, the code works fine so I wanted to check what response we are getting from server?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET MVC

From novice to tech pro — start learning today.