日期:2014-05-20 浏览次数:20710 次
<a href="#" id="aaa" runat="server" causesvalidation="false" onserverclick="AppointTimeChangedServerClick">test</a> <input type="button" id="button1aaaa" causesvalidation="false" value="clickme" runat="server" onserverclick="AppointTimeChangedServerClick" />
Code: protected void AppointTimeChangedServerClick(object sender, EventArgs e) { System.Web.UI.HtmlControls.HtmlAnchor an = sender as System.Web.UI.HtmlControls.HtmlAnchor; Response.Write(an.InnerText); }
<asp:UpdatePanel ID="_updateOpenTimes" runat="server" ......> <Triggers> <asp:PostBackTrigger ControlID="_filterSearchOpenButton" /> </Triggers> <ContentTemplate> .......... <asp:TemplateColumn HeaderText="Available Times"> <ItemTemplate> <a href="#" id="aaa" runat="server" causesvalidation="false" onserverclick="AppointTimeChangedServerClick">test</a> <input type="button" id="button1aaaa" causesvalidation="false" value="clickme" runat="server" onserverclick="AppointTimeChangedServerClick" /> </ItemTemplate> </asp:TemplateColumn> </Columns> <HeaderStyle CssClass="DataGridHeader" VerticalAlign="Middle" /> <ItemStyle CssClass="DataGridItem" VerticalAlign="Middle" /> <AlternatingItemStyle CssClass="DataGridAltItem" VerticalAlign="Middle" /> <PagerStyle CssClass="DataGridPager" VerticalAlign="Middle" /> </asp:DataGrid> </ContentTemplate> </asp:UpdatePanel>