Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Data Loading issue while calling serverside method
21/06/2011
19:26
Avatar
dineshsharmain
New Member
Members
Forum Posts: 1
Member Since:
21/06/2011
sp_UserOfflineSmall Offline

Hi

Below is my JQuery code, I want to make a server call like simple jquery post method but it doesn't call server methods  

JQuery Code -

jQuery("#jqgajax").jqGrid({

ajaxGridOptions: { type: "POST" },

serializeGridData: function (postdata) {

postdata.page = 1;

return postdata;

},

contentType: "application/json; charset=utf-8",

url: "gridData.aspx/GetData",

datatype: "json",

colNames: ['Part Id', 'Part Number', 'Description', 'Part Category', 'LOB Id'],

colModel: [

{ name: 'PartId', index: 'PartId', width: 55 },

{ name: 'PartNumber', index: 'PartNumber', width: 90 },

{ name: 'PartDescription', index: 'PartDescription asc', width: 100 },

{ name: 'PartCategoryId', index: 'PartCategoryId', width: 80, align: "right" },

{ name: 'LOBId', index: 'LOBId', width: 80, align: "right" }

],

rowNum: 10,

width: 700,

rowList: [10, 20, 30],

pager: '#pjqgajax',

sortname: 'PartNumber',

viewrecords: true,

sortorder: "desc",

caption: "Parts Details"

});

jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});

C# Code(File Name 'gridData.aspx') – Not being called

[WebMethod]

public static string GetData()

{

// Create a new Sql Connection and set connection string accordingly

SqlConnection sqlConnection = new SqlConnection();

sqlConnection.ConnectionString = "initial catalog=kaizen;data source=.;uid=realm;integrated security=SSPI";

sqlConnection.Open();

string sqlStatement = "select PartId, PartNumber, PartDescription, PartCategoryId, LOBId from partsdetails";

SqlCommand cmd = new SqlCommand(sqlStatement, sqlConnection);

DataTable dtResult = new DataTable();

SqlDataAdapter adp=new SqlDataAdapter(cmd);

adp.Fill(dtResult);

return GetJSONString(dtResult);

}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
78 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information