********HTML Code***************
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div style="margin-left:20px;">
- <br />
- <asp:Label ID="Label1" runat="server" Text="Click Here" ForeColor="#003300"></asp:Label>
- <br />
- <br />
- <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
- </div>
- </form>
- </body>
- </html>
********HTML Code***************
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- public partial class Post_Back : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- Label1.Text = "Page is not in Post back";
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- Label1.Text = "Page is in post back";
- }
- }

No comments:
Post a Comment