I've an application that displays information in a gridview:
the status of the button is set
on a Windows 2008 server the button displays with no issues, however when I view this page with the gridview the column with the button is empty on a Windows 2012 server. Has anyone seen this before? Any help/advice greatly appreciated.
<asp:GridViewID="GridView1"runat="server"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"Font-Size="X-Small"OnRowDataBound="GridView1_RowDataBound"PageSize="100"DataSourceID="SiteDataSource1"Width="100%"><PagerSettingsMode="NumericFirstLast"PageButtonCount="20"Position="TopAndBottom"/><RowStyleCssClass="itemstyle"/><HeaderStyleCssClass="headerstyle"/><AlternatingRowStyleCssClass="altstyle"/><Columns><asp:BoundFieldDataField="Description"HeaderText="Description"ReadOnly="True"SortExpression="Description"><ItemStyleWrap="False"/></asp:BoundField><asp:BoundFieldDataField="Identifier"HeaderText="Identifier"ReadOnly="True"SortExpression="Identifier"><ItemStyleWrap="False"/></asp:BoundField><asp:BoundFieldDataField="State"HeaderText="State"ReadOnly="True"SortExpression="State"><ItemStyleWrap="False"/></asp:BoundField><asp:BoundFieldDataField="HostHeaderValue"HeaderText="Host Header Value"ReadOnly="True"SortExpression="HostHeaderValue"/><asp:BoundFieldDataField="IPAddress"HeaderText="IP Address"ReadOnly="True"SortExpression="IPAddress"/><asp:BoundFieldDataField="Port"HeaderText="Port"ReadOnly="True"SortExpression="Port"/><asp:BoundFieldDataField="SSLPort"HeaderText="SSL Port"ReadOnly="True"SortExpression="SSLPort"/><asp:TemplateFieldShowHeader="False"><ItemTemplate><asp:ButtonID="Button1"runat="server"CausesValidation="false"CommandName="Control"OnClick="Button_Clicked"Text="Control"Width="50"/></ItemTemplate><ItemStyleWidth="50px"/></asp:TemplateField></Columns>
the status of the button is set
protectedvoid GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{try
{if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView entry = e.Row.DataItem as DataRowView;if (entry != null)
{switch (entry["State"] asstring)
{case"Stopped":
e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
((Button)e.Row.Cells[7].Controls[1]).Text = "Start";
((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Green;
((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] asstring + "|" + entry["Description"] asstring;break;case"Running":
e.Row.Cells[2].BackColor = System.Drawing.Color.Honeydew;
((Button)e.Row.Cells[7].Controls[1]).Text = "Stop";
((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Red;
((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] asstring + "|" + entry["Description"] asstring;break;default:
e.Row.Cells[2].BackColor = System.Drawing.Color.Yellow;
e.Row.Cells[7].Text = "";break;
}
on a Windows 2008 server the button displays with no issues, however when I view this page with the gridview the column with the button is empty on a Windows 2012 server. Has anyone seen this before? Any help/advice greatly appreciated.