vs 2012 .net 4.5 html 5
I need to send data from html table to the server.
function PostTable() {
$(document).ready(function()
{
var tableData = [];
$('#LPH_Files tr').each(function () {
{
var file={};
if ($(this).find("td:first").length > 0) {
var _fileName = $(this).find("td:first").html();
if (_fileName != '')
{
file.fileName = _fileName;
tableData.push(file);
}
}
}
});
var jsonRequest = tableData;
$.ajax({
type:'POST',
url:'UploadFiles.aspx/SaveRows',
data: JSON.stringify(jsonRequest),
contentType:'application/json; charset=utf-8',
dataType:'json',
async:false,
success:function (data, text) {
return true;
},
error:
function (request, status, error){
return false;
}
});
})
};
<System.Web.Services.WebMethod()> _
PublicFunction SaveRows(fileName AsFile) AsBoolean
Dim retval AsString = String.Empty
Try
MsgBox("")
Catch ex AsException
EndTry
Return retval
EndFunction