jQWidgets Forums
jQuery UI Widgets › Forums › Grid › GET not allowed
Tagged: dataadapter, grid
This topic contains 7 replies, has 3 voices, and was last updated by UJanke 12 years, 6 months ago.
-
AuthorGET not allowed Posts
-
#a24;\”>\’PackageStatus\’, type: \’string\’ },
{ name: \’HA_Strategy\’, type: \’string\’ },
{ name: \’HA_Type\’, type: \’string\’ },
{ name: \’HA_Currency\’, type: \’string\’ },
{ name: \’BookingUnit\’, type: \’string\’ },
{ name: \’PackageStatus\’, type: \’string\’ }
],
deleterow: function(rowid, commit) {
var dataRecord = $(\”#packagegrid\”).jqxGrid(\’getrowdata\’, rowid);
var DelpackeReturn = DeletePackage(dataRecord.PackageID);
commit(DelpackeReturn);
},
async: false,
record: \’Table\’,
ID: \’PackageID\’,
url: \’Haiz.aspx/getpackagelist\’
};
var packagedataAdapter = new $.jqx.dataAdapter(packagesource, { contentType: \’application/json; charset=utf-8\’} );
$(\”#packagegrid\”).jqxGrid({
source: packagedataAdapter,
width: \”99%\”,
hight: \”80%\”,
theme: theme,
sortable: true,
enablehover: true,
filterable: true,
pageable: true,
groupable: true,
columnsresize: true,
autoshowfiltericon: true,
selectionmode: \’singlerow\’,
showaggregates: true,
showstatusbar: true,
statusbarheight: 23,
autoshowcolumnsmenubutton: true,
showfilterrow: true,
keyboardnavigation: true,
altrows: true,
ready: function() {
$(\’#packagegrid\’).jqxGrid(\’clearselection\’);
$(\’#packagegrid\’).jqxGrid(\’selectrow\’, 0);
},
columns: [
{ text: \’Package ID\’, dataField: \’PackageID\’, width: 80, cellsalign: \’right\’, pinned: true, filtertype: \’number\’ },
{ text: \’Package Name\’, dataField: \’PackageName\’, width: \’auto\’, aggregates: [\’count\’], filtertype: \’textbox\’, filtercondition: \’contains\’ },
{ text: \’Designation Date\’, dataField: \’DesignationDate\’, width: DateWidth, cellsformat: myDateFormat, filtertype: \’date\’, editable: false },
{ text: \’End Date\’, dataField: \’EndDate\’, width: DateWidth, cellsformat: myDateFormat, filtertype: \’date\’ },
{ text: \’Status\’, dataField: \’PackageStatus\’, width: TextWidth, cellsalign: \’center\’, cellsrenderer: cellsrenderer, filtertype: \’checkedlist\’ },
{ text: \’Strategy\’, dataField: \’HA_Strategy\’, width: TextWidth, cellsalign: \’center\’, filtertype: \’checkedlist\’ },
{ text: \’Type\’, dataField: \’HA_Type\’, width: TextWidth, cellsalign: \’center\’, filtertype: \’checkedlist\’ },
{ text: \’Currency\’, dataField: \’HA_Currency\’, width: TextWidth, cellsalign: \’center\’, filtertype: \’checkedlist\’ },
{ text: \’BookingUnit\’, dataField: \’BookingUnit\’, width: TextWidth, cellsalign: \’center\’, filtertype: \’checkedlist\’ }
]
}); // Ende jqxGrid
} // Ende loadPackageGrid
CodeBehind:
_
_
Public Shared Function getpackagelist() As String
Dim query As String = \”SELECT * FROM vwvFrontEnd_HA_CPD order by PackageID desc\”
Dim cmd As New SqlCommand(query)
\’ Populate the DataSet.
Dim data As DataSet = GetData(cmd)
\’ return the vwvFrontEnd_HA_CPD table as XML.
Dim writer As New System.IO.StringWriter()
data.Tables(0).WriteXml(writer, XmlWriteMode.WriteSchema, False)
Return writer.ToString()
End FunctionHowever on my local maschine all works fine. On the target system i get the response:
{\”Message\”:\”An attempt was made to call the method \\u0027getpackagelist\\u0027 using a GET request, which is not allowed.\”,\”StackTrace\”:\” at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\\r\\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)\”,\”ExceptionType\”:\”System.InvalidOperationException\”}
Hm, so GET is not allowed, but where to adjust that in web.config. Or can we handle that with the dataadapter?
Greetings
UweHi UJanke,
In ASP .NET/ASP .NET MVC, use POST. I recommend you to take a look at the help documentation topics about using our tools with ASP .NET.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comfunction loadPackageGrid() {
packagesource = {
datatype: “xml”,
datafields: [{ name: ‘PackageID’, type: ‘numeric’ },
{ name: ‘PackageName’, type: ‘string’ },
{ name: ‘DesignationDate’, type: ‘date’ },
{ name: ‘EndDate’, type: ‘date’ },
{ name: ‘PackageStatus’, type: ‘string’ },
{ name: ‘HA_Strategy’, type: ‘string’ },
{ name: ‘HA_Type’, type: ‘string’ },
{ name: ‘HA_Currency’, type: ‘string’ },
{ name: ‘BookingUnit’, type: ‘string’ },
{ name: ‘PackageStatus’, type: ‘string’ }],
deleterow: function(rowid, commit) {
var dataRecord = $(“#packagegrid”).jqxGrid(‘getrowdata’, rowid);
var DelpackeReturn = DeletePackage(dataRecord.PackageID);
commit(DelpackeReturn);
},async: false,
record: ‘Table’,
ID: ‘PackageID’,
url: ‘Haiz.aspx/getpackagelist’
};var packagedataAdapter = new $.jqx.dataAdapter(packagesource, { contentType: ‘application/json; charset=utf-8’} );
$(“#packagegrid”).jqxGrid({
source: packagedataAdapter,
width: “99%”,
hight: “80%”,
theme: theme,
sortable: true,
enablehover: true,
filterable: true,
pageable: true,
groupable: true,
columnsresize: true,
autoshowfiltericon: true,
selectionmode: ‘singlerow’,
showaggregates: true,
showstatusbar: true,
statusbarheight: 23,
autoshowcolumnsmenubutton: true,
showfilterrow: true,
keyboardnavigation: true,
altrows: true,
ready: function() {
$(‘#packagegrid’).jqxGrid(‘clearselection’);
$(‘#packagegrid’).jqxGrid(‘selectrow’, 0);},
columns: [
{ text: ‘Package ID’, dataField: ‘PackageID’, width: 80, cellsalign: ‘right’, pinned: true, filtertype: ‘number’ },
{ text: ‘Package Name’, dataField: ‘PackageName’, width: ‘auto’, aggregates: [‘count’], filtertype: ‘textbox’, filtercondition: ‘contains’ },
{ text: ‘Designation Date’, dataField: ‘DesignationDate’, width: DateWidth, cellsformat: myDateFormat, filtertype: ‘date’, editable: false },
{ text: ‘End Date’, dataField: ‘EndDate’, width: DateWidth, cellsformat: myDateFormat, filtertype: ‘date’ },
{ text: ‘Status’, dataField: ‘PackageStatus’, width: TextWidth, cellsalign: ‘center’, cellsrenderer: cellsrenderer, filtertype: ‘checkedlist’ },
{ text: ‘Strategy’, dataField: ‘HA_Strategy’, width: TextWidth, cellsalign: ‘center’, filtertype: ‘checkedlist’ },
{ text: ‘Type’, dataField: ‘HA_Type’, width: TextWidth, cellsalign: ‘center’, filtertype: ‘checkedlist’ },
{ text: ‘Currency’, dataField: ‘HA_Currency’, width: TextWidth, cellsalign: ‘center’, filtertype: ‘checkedlist’ },
{ text: ‘BookingUnit’, dataField: ‘BookingUnit’, width: TextWidth, cellsalign: ‘center’, filtertype: ‘checkedlist’ }
]
}); // Ende jqxGrid} // Ende loadPackageGrid
_
_
Public Shared Function getpackagelist() As String
Dim query As String = “SELECT * FROM vwvFrontEnd_HA_CPD order by PackageID desc”
Dim cmd As New SqlCommand(query)
‘ Populate the DataSet.
Dim data As DataSet = GetData(cmd)
‘ return the Customers table as XML.Dim writer As New System.IO.StringWriter()
data.Tables(0).WriteXml(writer, XmlWriteMode.WriteSchema, False)
Return writer.ToString()
End Functionyour codeformater does strange things
so again ^^
Hi UJanke,
In ASP .NET/ASP .NET MVC, use POST. I recommend you to take a look at the help documentation topics about using our tools with ASP .NET.
For Code Formatting in the Forum see: http://www.jqwidgets.com/community/topic/code-formatting/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comWell, if i read your documentation, always find examples like
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]what works for me at the dev maschine. Just if i switch to the intregration server i setp into that Get not allowed. So i guess something wrog with the web.config.
If i use:
packagesource = {
datatype: “xml”,
type: “POST”,
datafields: [i step into:
{“Message”:”Invalid JSON primitive: filterscount.”,”Source:
filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=18So i’m realy stuck for the moment
Greetings Uwehave you tried adding this to your web.config:
<configuration> <system.web> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> </system.web></configuration>
Yes, thx grmbl, i already did. But still the same problem…
Greetings UweSo, for those which fall into the same ISS/ASP pit.
The problem here is the web.config file which pointed to old assembly’s. What means the ISS was still using NET2.0 and so on. You can check that if you find lines like this: “System.Web.Extensions, Version=1.0.61025.0,”
Well nobody links to reconfigure the wall of lines in the web.config, since there are several hundreds more of lines (sharepoint ect.)
Well you can of course do all of that manual. But expect after that an server “/” error.So what you can ans should do.
Build with Visual Studio a new Web Project. In this case use NET 2.0.
Open the generated Web.config, remove all content. (ctrl+A, del)
Open the Web.config from your Webserver.
Copy the whole content of it into the web.config of your 2.0 project.
Now choose project options > compile > switch to net 3.5.
Visual Studio will now rewrite the web.config to version 3.5.
copy now the content of that project web.config into that of your web server.
From now GET will work.Hope that helps at last one of you
Greetings
Uwe -
AuthorPosts
You must be logged in to reply to this topic.