Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta charset="utf-8" /> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Hello World!</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click">Привет Мир!</asp:LinkButton> <asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click">Clear</asp:LinkButton> <br /> <br /> <br /> <asp:Label ID="Label1" runat="server" EnableViewState="False"></asp:Label> </div> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta charset="utf-8" /> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Hello World!</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click">Привет Мир!</asp:LinkButton> <asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click">Clear</asp:LinkButton> <br /> <br /> <br /> <asp:Label ID="Label1" runat="server" EnableViewState="False"></asp:Label> </div> </form> </body> </html>
Default.aspx.cs
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) { } protected void LinkButton1_Click(object sender, EventArgs e) { Label1.Text = "Hello World!"; } protected void LinkButton2_Click(object sender, EventArgs e) { Label1.Text = "Привет Мир!"; } protected void LinkButton3_Click(object sender, EventArgs e) { Label1.Text = string.Empty; } }
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) { } protected void LinkButton1_Click(object sender, EventArgs e) { Label1.Text = "Hello World!"; } protected void LinkButton2_Click(object sender, EventArgs e) { Label1.Text = "Привет Мир!"; } protected void LinkButton3_Click(object sender, EventArgs e) { Label1.Text = string.Empty; } }