T
Thanh
I created an ASP.NET project and dropped a DataList on
the web form. I then wrote a simple class to return data:
namespace Playing
{
public class PositionData
{
private string name;
private string ticker;
public PositionData(string name, string ticker)
{
this.name = name;
this.ticker = ticker;
}
public string Name
{
get { return name; }
}
public string Ticker
{
get { return ticker; }
}
}
I then inserted the code to load data into the DataList
private void Page_Load(object sender, System.EventArgs
e)
{
if (!IsPostBack)
{
ArrayList values = new ArrayList();
values.Add(new PositionData("Microsoft", "Msft"));
values.Add(new PositionData("Intel", "Intc"));
values.Add(new PositionData("Dell", "Dell"));
DataList1.DataSource = values;
DataList1.DataBind();
}
}
}
When I run the application into IE 6, All I saw was a
blank screen with no DataList and nada. I try with
DataGrid and everything works fine.
What have I done wrong?
Thank you in advance for all your help.
the web form. I then wrote a simple class to return data:
namespace Playing
{
public class PositionData
{
private string name;
private string ticker;
public PositionData(string name, string ticker)
{
this.name = name;
this.ticker = ticker;
}
public string Name
{
get { return name; }
}
public string Ticker
{
get { return ticker; }
}
}
I then inserted the code to load data into the DataList
private void Page_Load(object sender, System.EventArgs
e)
{
if (!IsPostBack)
{
ArrayList values = new ArrayList();
values.Add(new PositionData("Microsoft", "Msft"));
values.Add(new PositionData("Intel", "Intc"));
values.Add(new PositionData("Dell", "Dell"));
DataList1.DataSource = values;
DataList1.DataBind();
}
}
}
When I run the application into IE 6, All I saw was a
blank screen with no DataList and nada. I try with
DataGrid and everything works fine.
What have I done wrong?
Thank you in advance for all your help.