IsPostBackEvent
in ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IsPostBackEvent.aspx.cs" Inherits="ASPNETALL.IsPostBackEvent" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<strong>First Name : </strong>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<strong>Last Name :
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
City : </strong>
<asp:DropDownList ID="ddlCity" runat="server" Height="16px" Width="116px">
</asp:DropDownList>
<br />
<br />
<asp:Button ID="btnReg" runat="server" OnClick="btnReg_Click" Text="Registration" />
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IsPostBackEvent.aspx.cs" Inherits="ASPNETALL.IsPostBackEvent" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<strong>First Name : </strong>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<strong>Last Name :
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
City : </strong>
<asp:DropDownList ID="ddlCity" runat="server" Height="16px" Width="116px">
</asp:DropDownList>
<br />
<br />
<asp:Button ID="btnReg" runat="server" OnClick="btnReg_Click" Text="Registration" />
</div>
</form>
</body>
</html>
IsPostBackEvent.aspx.cs
using System;
namespace ASPNETALL
public partial class IsPostBackEvent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
LoadCityDropDownLIst();
}
}
public void LoadCityDropDownLIst()
ListItem li1 = new ListItem("Uttar Pradesh");
ListItem li2 = new ListItem("Bihar");
ListItem li3 = new ListItem("Jharkhand");
}
protected void btnReg_Click(object sender, EventArgs e)
}
}
}
0 comments
Post a Comment