Click here to Skip to main content
15,887,867 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Formulas Pin
BobInNJ13-Oct-11 8:04
BobInNJ13-Oct-11 8:04 
AnswerRe: Formulas Pin
Shameel12-Oct-11 23:17
professionalShameel12-Oct-11 23:17 
AnswerRe: Formulas Pin
AditSheth13-Oct-11 19:40
AditSheth13-Oct-11 19:40 
AnswerRe: Formulas Pin
phil.o28-Oct-11 2:29
professionalphil.o28-Oct-11 2:29 
QuestionPublishing website with Report Viewer control Pin
countmein6-Oct-11 15:18
countmein6-Oct-11 15:18 
AnswerRe: Publishing website with Report Viewer control Pin
countmein9-Oct-11 4:03
countmein9-Oct-11 4:03 
AnswerHow to receive dataset in jquery Pin
goplappu3-Oct-11 20:51
goplappu3-Oct-11 20:51 
GeneralRe: How to receive dataset in jquery Pin
Dennis E White8-Oct-11 15:41
professionalDennis E White8-Oct-11 15:41 
question, statement or are you just giving us your current status?? Smile | :)

the way that I have generally done something like this is to call some
C#
[WebMethod]
either in a web service or a page method. technically those
C#
public static
page methods are nothing but web service methods. at least in my opinion they are.

C#
[WebMethod]
[System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml)]
public DataTable someMethod(string param)
{
     DataSet dsReturn;

     try
     {
          // do your database stuff

          // I like to name the table so that it makes parsing it in jQuery easier for me
          dsReturn.Tables[0].TableName = "someName";
     }
     catch (Exception)
     {
          // do your error handling
          throw;
     }

     return dsReturn.Tables[0];
}


then my jQuery code I use the
JavaScript
$.ajax(...)
function to call the web service.

JavaScript
$.ajax({
     type: 'POST',
     url: 'location/name.asmx/someMethod',
     data: "{ 'param': 'paramValue' }",
     contentType: 'application/json; charset=utf-8',
     dataType: 'xml',
     success: function (xml) {
          // parse and loop through the records in the datatable
          $('someName', xml).each(function() {
               // your this pointer actually is a record in your datable 
               $(this).find('ColumnName').text();
          });
     },
     error: function(err) {
           // do your jQuery error handling here
     }
});

Questionjquery Pin
goplappu3-Oct-11 20:50
goplappu3-Oct-11 20:50 
Answerok, i will play... Pin
cjoki4-Oct-11 8:25
cjoki4-Oct-11 8:25 
GeneralRe: ok, i will play... Pin
Not Active4-Oct-11 12:44
mentorNot Active4-Oct-11 12:44 
GeneralRe: ok, i will play... Pin
cjoki5-Oct-11 4:48
cjoki5-Oct-11 4:48 
AnswerRe: jquery Pin
Dalek Dave6-Oct-11 22:33
professionalDalek Dave6-Oct-11 22:33 
GeneralRe: jquery Pin
Pravin Patil, Mumbai12-Oct-11 22:40
Pravin Patil, Mumbai12-Oct-11 22:40 
QuestionHELP Pin
xero-Legendz1-Oct-11 12:50
xero-Legendz1-Oct-11 12:50 
AnswerRe: HELP Pin
Richard MacCutchan1-Oct-11 21:32
mveRichard MacCutchan1-Oct-11 21:32 
AnswerRe: HELP Pin
Dalek Dave1-Oct-11 22:41
professionalDalek Dave1-Oct-11 22:41 
SuggestionHELP CSS Text Problem! Pin
55533628-Sep-11 0:04
55533628-Sep-11 0:04 
GeneralRe: HELP CSS Text Problem! Pin
killabyte11-Oct-11 17:10
killabyte11-Oct-11 17:10 
GeneralRe: HELP CSS Text Problem! Pin
AditSheth13-Oct-11 18:53
AditSheth13-Oct-11 18:53 
AnswerRe: HELP CSS Text Problem! Pin
Sunasara Imdadhusen15-Oct-11 4:04
professionalSunasara Imdadhusen15-Oct-11 4:04 
AnswerRe: HELP CSS Text Problem! Pin
AditSheth16-Oct-11 18:46
AditSheth16-Oct-11 18:46 
Questionis it possible to share the web.config across multiple projects in a solution?(ASP.NET) Pin
byka22-Sep-11 2:21
byka22-Sep-11 2:21 
AnswerRe: is it possible to share the web.config across multiple projects in a solution?(ASP.NET) Pin
Not Active22-Sep-11 2:29
mentorNot Active22-Sep-11 2:29 
GeneralRe: is it possible to share the web.config across multiple projects in a solution?(ASP.NET) Pin
byka22-Sep-11 3:10
byka22-Sep-11 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.