../images/Emo12.gif
טוב, טוב, לא צריך להתעצבן...
Code Front (מה המילה של זה
):
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Trace="True" Inherits="WebTest.WebForm2" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>WebForm2</title> <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="WebForm2" method="post" runat="server"> <asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 129px; POSITION: absolute; TOP: 139px" runat="server" Width="214px" Height="10px">Label</asp:Label> <asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 34px; POSITION: absolute; TOP: 44px" runat="server"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 263px; POSITION: absolute; TOP: 50px" runat="server" Text="Button" TabIndex="0"></asp:Button> </form> </body> </HTML>
וה-Code Behind:
using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WebTest { /// <summary> /// Summary description for WebForm2. /// </summary> public class WebForm2 : System.Web.UI.Page { protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.TextBox TextBox1; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Response.Write("Page_Load"); } protected override void RaisePostBackEvent(IPostBackEventHandler sc, string ea ) { base.RaisePostBackEvent(sc, ea); Trace.Write(sc.ToString()); Trace.Warn(ea); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void Button1_Click(object sender, System.EventArgs e) { Label1.Text = "Hello " + TextBox1.Text; } } }
זה טופס פשוט מאוד... אפילו הכי פשוט שיש