Why do my ASP.NET pages render slowly when placed on the server?

前端 未结 7 506
忘了有多久
忘了有多久 2021-01-27 07:43

I have a simple aspx page with a GridView control. I\'m loading the GridView with search results after the click of a button. Everything works, but the HTML rendering on the bro

7条回答
  •  攒了一身酷
    2021-01-27 08:00

    If you need ViewState on the control, you can reduce the ViewState impact the GridView has on the page by disabling the ViewState on each row in the PreRender event:

      Private Sub grid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grid.PreRender
    
        For Each item As DataGridItem In grid.Items
          item.EnableViewState = False
        Next
    
      End Sub
    

提交回复
热议问题