We have to make an ASP.NET MVC or ASP.NET application for basic ajax navigation in Customer.html of Notrhwind.mdb.
We have this 3 things:
A pure HTML/Javascript form having HTML input text tags, one for each field of Customers table. We have also 2 navigation buttons: NextRecord and PrevRecord having at OnClick() event : clientGetRecord(NextOrPrev)
A javascript ajax clientGetRecord function, something like this: function clientGetRecord(NextOrPrev) { var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP"); var sURL = "ServerGetRecord.aspx?ID=" + NextOrPrev; oXMLHTTP.open( "POST", sURL, FALSE ); oXMLHTTP.send(); var sResult=oXMLHTTP.responseText; var aRecord = sResult.split(";"); document.getElementById('CustomerID').value = aRecord[0]; document.getElementById('CompanyName').value = aRecord[1]; document.getElementById('ContactName').value = aRecord[2]; document.getElementById('Adress').value = aRecord[3]; //... and so on ... };
We must have something like a ServerGetRecord controler function which returns to the clientGetRecord function, a simple string containing the current record fields values separated by comma and using classic ADO database handling.
The question is : How to program and invoke the ServerGetRecord function? Can i have a VB code example of ServerGetRecord function (or ASPX, or ASHX, or something else?..) ?
Thank you very much!..