jQuery UI Widgets › Forums › Grid › Bind jqxGrid to SQL Database using ASP.NET
Tagged: angular grid, asp, asp.net, data, database, grid, jquery grid, jqxgrid, method, MVC, parameter, pass, pass parameter, server-side, sql
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 9 years ago.
-
Author
-
hello I have a question about the example
I can pass as parameters to the method GetCustomers
I need to load a grid with values that control the page to loadI can just load the grid without sending parameters
I need you help
Hello migue,
Parameters can be send to the server side (i.e. the GetCustomers method) with the data property of the source object, e.g.:
source = { datatype: "xml", datafields: [{ name: 'CompanyName' }, { name: 'ContactName' }, { name: 'ContactTitle' }, { name: 'City' }, { name: 'Country' }, { name: 'Address' }], async: false, record: 'Table', url: 'Default.aspx/GetCustomers', data: { customParameter1: value1, customParameter2: value2 } };
Alternatively, you can pass a parameter directly in the url, e.g.:
url: 'Default.aspx/GetCustomers/5',
The latter can be seen demonstrated in the help topic CRUD with jqxGrid, ASP.NET MVC3 and SQL (e.g.
url: '/Employees/Delete/5'
).Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ok but as I declare the method in c # server side
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
public static string Documentos(string condicion)
{
StringWriter writer;
ClsUtilerias lib = new ClsUtilerias();
DataSet data = lib.ejecutarConsultaEnDataSet(“exec spt_Consulta_Ejecutiva_Maestra “+condicion);
if (data.Tables[0].Rows.Count > 0)
{
// return the Customers table as XML.
writer = new System.IO.StringWriter();
data.Tables[0].WriteXml(writer, XmlWriteMode.WriteSchema, false);
return writer.ToString();
}
else { return “”; }
}so the method but have not come to run when I put the varibles the parameter
Hi migue,
I am not sure I understand what your issue actually is, but in my previous post I have specified valid ways of passing parameters from the client side to the server side. Please also note that, generally, we do not provide support regarding custom back end implementations.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.