asp.net question

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

What is the difference between using statement 1 and 2 ? I got the same
result.

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList countries = new ArrayList();
countries.Add("England");
countries.Add("France");
countries.Add("Sweden");
countries.Add("Denmark");
countries.Add("Italy");
countryList.DataSource = countries;
1 Page.DataBind();
2. countryList.DataBind();
}
}

//Tony
 
Hello!

What is the difference between using statement 1 and 2 ? I got the same
result. [..]
1          Page.DataBind();
2.         countryList.DataBind();

1. Binds all data bound controls on the page, 2. only the countryList
control is bound.
If countryList is the only control with data binding on the page, then
in fact, the two statements are equivalent.

MiB.
 
Back
Top