ITsolutionWizard
asked on
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?
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);
}
$.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);
}
});
<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>
ASKER
any one here ?
What is the maximum size you are trying to post? any approximation?
ASKER
I don't the size. just tell me what else I need to do on the setting
ASKER
any helps?
ASKER
any helps?
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.
ASKER
not upload it is Json response
Did you try to debug it on server side? Or it fails before you hit the breakpoint? What do you get in JsonResponse?
ASKER
all i see object object alert in js.
But that would mean
The call was successful. If there was an error you would see alert("Error " + error);
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.
The call was successful. If there was an error you would see alert("Error " + error);
var id = data.outputHTML;
alert("Success");
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.
ASKER
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.
Did you change the web.config's 2147483647 value to 214748364 or even that was not needed?
ASKER
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>
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?
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");
},
ASKER
I change the number and add debugger there.
The response is no change.
The response is no change.
ASKER
any progress?
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?
Also do you see any alert message?
ASKER
hi chinmay, i am not sure you refer to.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER