The more I use ASP.NET, the more if (!IsPostBack) {} seems pointless...
First example:
For example, I just Googled an issue, they said use this
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
SqlConnection conn = new SqlConnection("Data Source=-----; Database=-----; Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter();
conn.Open();
da.SelectCommand = new SqlCommand("Select Command",conn);
conn.Close();
DataTable dt = new DataTable();
da.Fill(dt);
ddlSearch.DataSource = dt;
ddlSearch.DataTextField = "---";
ddlSearch.DataValueField = "---";
ddlSearch.DataBind();
}
}