Skip to content

zabelin-vladimir/aspxgridview-how-to-save-selected-rows-to-the-database-by-using-webmethods-t355128

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASPxGridView - How to save selected rows to the database by using WebMethods

This example shows how to save and retrieve selection state of the row. It is realized by using WebMethods. On page loading, selection state is retrieved from the database and ASPxGridView rows are selected by the SetSelection method. When a row is selected, the client-side ASPxClientGridView.SelectionChanged event is raised and the UpdateDB method is called. This method updates a database.
On the client side, WebMethod is called by

PageMethods.UpdateDB(array);

On the server side, ScriptManager is used with EnablePageMethods set in "True".

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>

and the C# method is marked by WebMethodAttribute 

using System.Web.Services;
 [WebMethod]
public static void UpdateDB(object[] array) {
//method code
}

 

See also:
ASPxGridView - How to save selected rows to the database when ProcessSelectionChangedOnServer is True
How to track progress of server side processing on the client side (using WebMethods)


About

.NET, ASP.NET Web Forms, ASPxGridView

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Classic ASP 54.4%
  • C# 45.6%