前台调用后台方法除了用button的click事件,还能够用js调用html
1、前台页面如图ui
需求点击这个按钮触发后台事件,从而可以调用存储过程spa
<epoint:HyperLinkColumn HeaderText="考评算分" 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>//调用js </ItemTemplate> </epoint:HyperLinkColumn>
2、js方法3d
pagemethod定义能够参考这个连接查看code
1.页面中须要添加ScriptManager组件,而后将它的EnablePageMethods属性设置为True。server
2.编写页面方法时也要向调用WebService同样,在方法前加[WebMethod],调用WebService与PageMethods实际上是同出一辙,原理都是同样的。htm
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> </asp:ScriptManager>
最后大功告成!blog