在我的页面加载中,显示了gridview标头,但几秒钟后它自动消失了。
<asp:GridView ID="GridView1" HeaderStyle-CssClass="bg-blue" ShowHeaderWhenEmpty="true" runat="server" AutoGenerateColumns="true" ViewStateMode="Enabled" CssClass="table table-bordered">
<Columns>
<asp:BoundField DataField="F4" HeaderText="Employee Code"></asp:BoundField>
<asp:BoundField DataField="F6" HeaderText="Employee Name"></asp:BoundField>
</Columns>
在页面加载中:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Label2.Visible = false;
GridView1.DataSource = new System.Collections.ArrayList();
GridView1.DataBind();
}
}