datagrid disappear on postback
-
I'm having a problem with a datagrid in asp.net. The datagrid loads okay, but during a postback it loses its data, for example when a button is clicked. I'm rebinding the datagrid in the page_load section, for ex: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If (Page.IsPostBack) Then dgridAnswers.DataSource = Session("svRsltTable") dgridAnswers.DataBind() End If The first time I bind the grid is in a function, for ex: Session("svRsltTable") = dSetAnsCmntQt.Tables("RsltTable") dgridAnswers.DataSource = Session("svRsltTable") dgridAnswers.DataBind() I load the session variable in this function so I can use it in the Page_load section to rebind it later. The columns is set to autoGenerateColumns =False. Thanks for any help.
-
I'm having a problem with a datagrid in asp.net. The datagrid loads okay, but during a postback it loses its data, for example when a button is clicked. I'm rebinding the datagrid in the page_load section, for ex: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If (Page.IsPostBack) Then dgridAnswers.DataSource = Session("svRsltTable") dgridAnswers.DataBind() End If The first time I bind the grid is in a function, for ex: Session("svRsltTable") = dSetAnsCmntQt.Tables("RsltTable") dgridAnswers.DataSource = Session("svRsltTable") dgridAnswers.DataBind() I load the session variable in this function so I can use it in the Page_load section to rebind it later. The columns is set to autoGenerateColumns =False. Thanks for any help.