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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top