I have a ASP.NET page using a PlaceHolder. Grids are build programmatically and added to this PlaceHolder when the page is run. Example:
ASPX Code:
<asp:PlaceHolder ID="myPlaceHolder" runat="server" />
Code behind:
foreach (var country in Tables.Countries())
{
var nGrid = BuildGrid(country.Code);
if (nGrid.Rows.Count > 0)
{
var lTitle = new Literal();
lTitle.Text = "<h2>Stats for country " + country.Name + "</h2>";
myPlaceHolder.Controls.Add(lTitle);
myPlaceHolder.Controls.Add(nGrid);
}
nGrid.Dispose();
}
private GridView BuildGrid(short countryCode)
{
GridView nGrid = new GridView();
nGrid.ID = "gr_" + countryCode;
nGrid.SkinID = "rpSkin";
nGrid.AutoGenerateColumns = false;
nGrid.AllowPaging = false;
nGrid.AllowSorting = false;
nGrid.RowStyle.VerticalAlign = VerticalAlign.Top;
nGrid.EnableViewState = false;
var nField = new BoundField
{
HeaderText = "People",
DataField = "PeopleCount"
};
nGrid.Columns.Add(nField);
// more BoundFields of this type exist
// This is basically the GridViewHelper class that gets Row Totals
// Disabling this doesn't help, either
HelpGrid(nGrid);
nGrid.DataSource = Country.GetPeople(countryCode);
nGrid.DataBind();
return nGrid;
}
This page works flawlessly in Opera and Firefox. Internet Explorer 8 shows me the "cannot display the webpage" screen.
Any ideas?