)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: ASP.NET Web Forms |
Control: Grid |
Published Date: September 18, 2015 |
Last Revised Date: September 18, 2015
Tags: ejgrid, grid

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

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon