Saturday 14 September 2013

Run asp.net page method in background

Run asp.net page method in background

I have one page method in asp.net. I want to run this in background.
In the javascript the code is as below:
function UpdatePowerValues()
{
PageMethods.GetUpdatedPowerValues(onSuccess, onError);
}
function onSuccess(result) {
for (var deviceIP in result) {
var deviceValues = result[deviceIP].DeviceValues;
if (deviceValues != null) {
var $deviceInfoTable = $("table[key='" + deviceIP + "']
span");
$.each($deviceInfoTable, function () {
if ($(this).attr("propName") !== undefined) {
$(this).text(deviceValues[$(this).attr("propName")]);
}
});
}
}
}
In the code behind file the Web method is of following:
[ScriptMethod, WebMethod]
public static IDictionary<string, string> GetUpdatedPowerValues()
{
IDictionary<string, string> dataDictionary = null;
SOME FUNCTIONALITY WILL BE DONE & dataDictionary is returned
return dataDictionary ;
}
I want this pagemethod to run in background. Please help me out.

No comments:

Post a Comment