В настоящее время я выполняю перетаскивание в строки GridView, который отправляет новый порядок строк в WebMethod , чтобы обновить базу данных в соответствии с этими новыми значениями.
Итак,Как я могу обновить GridView в веб-форме после вызова WebMethod?Учитывая, что я не могу получить доступ к любому из элементов веб-формы из WebMethod.
Веб-метод:
[WebMethod]
public static void GridViewCarriersReorders(string Reorder)
{
Boolean result;
string[] ListID = Reorder.Split('|');
transactions tr = new transactions();
result = tr.updateLcrPriorities(ListID);
//updateGridViewCarriers(); //SOMETHING LIKE THIS IS NEEDED TO DO THE BINDING
}
Большое спасибо за вашу помощь и понимание.
ОБНОВЛЕНИЕ : Вот как я называю веб-метод:
$.ajax({
type: "POST",
url: "lcrP.aspx/GridViewCarriersReorders",
data: '{"Reorder":"' + strorder + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg) {
$.jGrowl("The Carriers priority was successfully updated", { theme: "succeeded" });
}
})