开发者

HTML buttons: Code-behind operation

Earlier, I had a button control on my web page. but now I changed it to a CSS button suting my needs. Before this, the button control was performing code-behind operation but now I switched to this CSS button.

<a href="" title="" class="">Delete profile</a>

How can I accomplish the same code-behind proc开发者_运维技巧ess now?


You can change the anchor to be a server side control (turning it to a HtmlAnchor control) and use the ServerClick event:

<a href="" title="" class="" id="cssButton" runat="server">Delete profile</a>


To keep it simple, you could use a linkbutton and get the server side click event

   <asp:LinkButton ID="lb1" runat="server" onclick="lb1_Click" CssClass="cssClass" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜