Created
December 21, 2011 06:34
-
-
Save masaru-b-cl/1504914 to your computer and use it in GitHub Desktop.
ItemCommand Event Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
public partial class _Default : System.Web.UI.Page | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
FormView1.DataSource = new[] { new { MyCode = "0001" } }; | |
Page.DataBind(); | |
} | |
protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e) | |
{ | |
Label1.Text += "Hello "; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<div> | |
<asp:FormView ID="FormView1" runat="server" | |
onitemcommand="FormView1_ItemCommand"> | |
<ItemTemplate> | |
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> | |
<asp:Button ID="Button1" runat="server" Text="Button" /> | |
</ItemTemplate> | |
</asp:FormView> | |
<asp:Label ID="Label1" runat="server"></asp:Label> | |
</div> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment