parameter in JqGrid function
i've got this code to fill some data in a JQuery Grid, it't working fine but i want to give a parameter in the GetCustomers function for example GetCustomers(string username), how can i set the parameter in the getCustomerData url: 'Default.aspx/GetCustomers' ??:
//JAVASCRIPT CODE
function getCustomerData () {
//Getting the source data with ajax GET request
source = {
datatype: "xml",
datafields: [
{ name: 'CompanyName' },
{ name: 'ContactName' },
{ name: 'ContactTitle' },
{ name: 'City' },
{ name: 'Country' },
{ name: 'Address' }
],
async: false,
record: 'Table',
url: 'Default.aspx/GetCustomers',
};
var dataAdapter = new $.jqx.dataAdapter(source,
{ contentType: 'application/json; charset=utf-8'}
);
$("#jqxgrid").jqxGrid({
source: dataAdapter,
theme: 'classic',
columns: [
{ text: 'Company Name', dataField: 'CompanyName', width: 250 },
{ text: 'Contact Name', dataField: 'ContactName', width: 150 },
{ text: 'Contact Title', dataField: 'ContactTitle', width: 180 },
{ text: 'Address', dataField: 'Address', width: 180},
{ text: 'City', dataField: 'City', width: 80 },
{ text: 'Country', dataField: 'Country', width: 100}
]
});
}
//C# CODE
public static string GetCustomers()
{
//GETS THE DATA FROM THE DATABASE
}