Here's a small example of how a custom button can be used:
The. aspx code is as follows:
<%@ page language= "C #" autoeventwireup= "true" codefile= "custom button. Aspx.cs" inherits= "Custom button"%><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
The. Aspx.cs code is as follows:Using system;using system.collections.generic;using system.linq;using system.web;using System.Web.UI;using System.web.ui.webcontrols;public Partial class Custom button: system.web.ui.page{ protected void Page_Load (object sender, EventArgs e) { } protected void myCMD (Object Sender,commandeventargs e) { switch (e.commandname) { Case "group1": Response.Write (e.commandargument); break; Case "Group2": Response.Write (e.commandname); Break;}}}
The effect is as follows:
Custom buttons within the data template in the ListView