We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to trigger server events by using PageMethods mechanism of the ASP.NET?

In the ASP wrapper, though the Grid has in-built support for server-side events for certain grid actions, you may have to trigger a server-side event externally as per the requirement.

Solution

You can trigger a server-side event by using PageMethods mechanism of the ASP.NET application. The PageMethods acts similar to that of the AJAX call. Refer to the following link for more details on the PageMethods:

http://aspalliance.com/1922_PageMethods_In_ASPNET_AJAX.1

 

In the following example, the DataSource is bound to the Grid by using the PageMethods in Load client-side event of the Grid.

Render the Grid.

 

ASPX

 

JS

 

The PageMethods mechanism is enabled as given in the following code example.

 

At the server side, the DataSource for the Grid is returned.

ASPX.CS

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5421 09/18/2015 09/18/2015 ASP.NET Web Forms Grid
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.