Forum Replies Created
-
Author
-
October 30, 2012 at 9:08 am in reply to: Cannot make server side paging work with ASP.NET Web Service Cannot make server side paging work with ASP.NET Web Service #10199
Hi Peter
Yes the page
adresses this issue and comes up with a solution for $.ajax calls, but none that I can utilize for the datasource. It still translates into a text/hml call which makes ASMX services return XML rather than JSON.
I have however managed to make it work a ASP.NET Generic handler and while this is far from an elegant solution it works, and I have been stuck with this for a week now, so I will let it be for now.
Thanks for your assistance.
Soeren
October 29, 2012 at 2:54 pm in reply to: Cannot make server side paging work with ASP.NET Web Service Cannot make server side paging work with ASP.NET Web Service #10162I think that I have found out why there is a problem here and it appears as if you have a bug in your way of accessing WebServices
It is explained here:
http://encosia.com/asmx-scriptservice-mistake-invalid-json-primitive/
basically, it explains why use of parameters causes contentType to be changed to
application/x-www-form-urlencoded
which in turn causes ASMX Web Services to malfunction.
It also explains how to fix it.
The fix is to use ‘data’ to assign parameters rather than using url’ values. Can I overwrite your default behaviour in order to do this?
October 26, 2012 at 10:28 am in reply to: Grid server side paging from ASP.NET service Grid server side paging from ASP.NET service #10067Hi
I started with that example but in order to follow your instructions, I have changed it back.
I think that I found out what the cause is but dont know how to fix it. Your code make a response with the form:
GET /Cob/EodOverviewWebService.asmx/GetOverviewLines?pagenum=0&pagesize=10 HTTP/1.1
And this causes the error:
Request format is unrecognized for URL unexpectedly ending in '/GetOverviewLines'.
I think it is the combination of an URL that identifies a method and using get parameters, but since your code stresses that one should use GET and not POSTS, I am a bit lost.
As mentioned earlier I cannot figure out how to install an errorhandler to this datasource request.
Here is the new code:
source = { url: 'EodOverviewWebService.asmx/GetOverviewLines', contentType: 'application/json; charset=utf-8', datatype: "json", datafields: [ { name: 'Id' }, { name: 'TimeToFire' }, { name: 'SysDate' }, { name: 'NewDate' }, { name: 'Status' }, { name: 'ReasonForExecution' }, { name: 'ModulesExecuted' } ], async: false, formatdata: function (data) { return { pagenum: data.pagenum, pagesize: data.pagesize }; } }; $.ajax({ url: 'EodOverviewWebService.asmx/GetOverviewCount', contentType: 'application/json; charset=utf-8', async: false, error: errorHandler, success: function (data) { source.totalrecords = data.d; } }); var dataadapter = new $.jqx.dataAdapter(source); $("#jqxOverviewGrid").jqxGrid( { width: 600, source: dataadapter, theme: theme, autoheight: true, pageable: true, virtualmode: true, rendergridrows: function () { return dataadapter.records; }, columns: [ { text: 'Task id', datafield: 'Id', width: 250 }, { text: 'Execution date', datafield: 'TimeToFire', width: 200 }, { text: 'System date', datafield: 'SysDate', width: 200 }, { text: 'New date', datafield: 'NewDate', width: 180 }, { text: 'Modules executed', datafield: 'ModulesExecuted', width: 100 }, { text: 'Reason for execution', datafield: 'ReasonForExecution', width: 140 }, { text: 'Status', datafield: 'Status', width: 140 } ] });
and server side:
[WebMethod(EnableSession = true)] [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] public List<EodRow> GetOverviewLines(int pagenum, int pagesize) { int skip = pagenum*pagesize; int take = pagesize; string environment = ((TaskEnvironment) HttpContext.Current.Session[WebConstants.SessionTaskEnvironment]).EnvironmentName; List<EodDao.EodStatusAndTask> eodStatusAndTaskListForEnvironment = EodDao.GetEodStatusAndTaskListForEnvironment(environment, skip, take); List<EodRow> eodRowList = new List<EodRow>(); foreach (EodDao.EodStatusAndTask eodStatusAndTask in eodStatusAndTaskListForEnvironment) { EodRow eodRow = null; if (eodStatusAndTask.EodStatus != null) { bool anyErrors = EodDao.HasErrors(eodStatusAndTask.EodStatus.Id); eodRow = new EodRow(eodStatusAndTask.Task.Id, eodStatusAndTask.Task.TimeToFire, eodStatusAndTask.EodStatus.SysDate, eodStatusAndTask.EodStatus.NewDate, eodStatusAndTask.Task.StatusEnum, eodStatusAndTask.EodStatus.ReasonForExecution, eodStatusAndTask.EodStatus.ModulesExecuted, anyErrors); } else { eodRow = new EodRow(eodStatusAndTask.Task.Id, eodStatusAndTask.Task.TimeToFire, null, null, eodStatusAndTask.Task.StatusEnum, null, null, false); } eodRowList.Add(eodRow); } return eodRowList; } [WebMethod(EnableSession = true)] [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] public int GetOverviewCount() { string environment = ((TaskEnvironment)HttpContext.Current.Session[WebConstants.SessionTaskEnvironment]).EnvironmentName; return EodDao.GetEodStatusRelatedTaskCount(environment); }
Hi serder,
Unfortunately I havent been able to solved that either, but if you find out, I would be happy to know too.
October 25, 2012 at 9:33 am in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10028I have now managed to get it working on my own ASP.NET server.
Thanks
October 24, 2012 at 3:47 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10009Hi Peter
I am almost there. But it appears as if I am using the wrong content-type because Excel shows the xml rather than the formatted content.
I use: application/vnd.ms-excel
Is this correct?
October 24, 2012 at 2:20 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10006Yes, I see: It should be fairly easy to handle it my self on the server ๐
Thanks, Peter
October 24, 2012 at 2:10 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10005Sorry our last posts overlapped, this sounds interesting and I will investigate the possibilities.
Do you have any documentation? I could not find anything on exportdata.
Btw, do you have additional information regarding the quistion on clibboard fetures? One of my users has already pointed out that he could copy/paste from the previous ASP.NET Gridview based picture.
October 24, 2012 at 2:05 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10003Actually, please disregard the discussion about access to your site, because I just realized that the server which runs this solution has no access to the internet at all.
As damage control: Do you plans to allow users to copy cell or line values in a jqxGrid to the clipboard?
October 24, 2012 at 1:57 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #10000I understand that you dont store it.
Up until now I have *NOT* understood that the data was send on the internet at all. If I had not discovered this and wrote a program that transmitted customer or account related informaion to your site over the internet, I would be expelled and blacklisted.
For now our focus are on less sensitive information, but I interprete your latest answer as if I cannot be sure that this feature will be available or my usage of it in a production scenario would be allowed.
I can understand your position, but I really, really recommend that you state in your demo and documentation, that this feature can only be used by customers using PHP.
Actually I am now in a delicate position because grids with Excel export was one of my selling points of jqWidgets in my organisation, and now I have to tell that it cannot be used at all.
This information would have been nice to have initially.
In a large organization you cannot just setup a PHP installation. You can only use pre-approved technologies based on a Development and Operations Strategy.
October 24, 2012 at 1:13 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #9995It doesnt fit in at all, I will have to wait for an ASP.NET version, but for now we maybe can use the current feature for techinal data. As a temporary improvement, I suggest that you turn on HTTPS for this.
Thanks for your swift answer.
October 24, 2012 at 12:58 pm in reply to: Download of exported data and www.jqwidgets.com Download of exported data and www.jqwidgets.com #9991Even though they are not saved there are no chance that I will get permission to post data to your server.
How does the Server Side files distributed fit into an ASP.NET WebForms project?
๐ And now it works.
Thanks
Hi
Thanks for your help, that swithced the text orientation perfectly.
It did raise another issue though. I Show 20 bars, but only 11 of them have a legend text despite the fact that the tooltip shows that I have set the legend text for all 20.
It can be reproduced in your example if you switch to 20 countries rather than 5.
Best regards
SรธrenIt worked perfectly, thanks ๐
-
AuthorPosts