About a control in the DataGrid that uses JS to invoke a background method event

Source: Internet
Author: User

Foreground call background method in addition to using the button's Click event, you can also use JS call

First, the front page

Demand Click this button to trigger a background event to be able to invoke the stored procedure

<epoint:hyperlinkcolumn headertext= "Evaluation and calculation points" name= "SetUp" navigatetext= "<div class=" Small-icon Small-icon-setting ' ></div> ' isautowidth= ' true ' >
<itemstyle horizontalalign= "Center" width= "50px"/>
<itemtemplate >
<div class= ' Small-icon small-icon-setting ' onclick= ' showsetting (' <% #Convert. ToString (Eval ("RowGuid"))%> ' );" ></div>//Call JS
</ItemTemplate>
</epoint:HyperLinkColumn>

Second, JS method

Pagemethod definitions can refer to this link to view

1. Add the ScriptManager component to the page and set its Enablepagemethods property to True.

2. Write the page method also to call WebService, before the method add [WebMethod], call WebService and Pagemethods is actually expatiating, the principle is the same.

  <asp:scriptmanager id= "ScriptManager1" runat= "Server" enablepagemethods= "true" >
</asp:ScriptManager>

Finally done!

About a control in the DataGrid that uses JS to invoke a background method event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.