I am creating a data entry form to allow the user to create bullet items and sub bullet items for storage in a SQL Server table. These items are stored in the database with codes denoting whether the item is a bullet point or a sub-bullet point. This data is used to create a dynamic ASP.Net page. The data is read and constructed into unordered lists on the output web pages.
To allow the users to enter these bullet points in a method where they would resemble what they would look like in a list, I build a two column "asp:table" with text boxes inserted in each cell. I provide a button for the user to add rows if they need to add more bullet points.
HOWEVER ..... when the button is clicked, the row is added to the table but a row previously is lost. I know this is VIEWSTATE management problem. The table is not being set as being "dirty" in the viewstate. I believe I need to do that within the button click event that is adding rows to the table.
HOWEVER ..... I cannot figure out how to do this. I have been reading about state mangement and I have been reading about serialization of objects (because that is one of the errors I get when I try to add the table object to the state).
Does anyone have a chunk of code in VB that shows how to add a table to the viewstate or the StateBag (whichever it is that I am supposed to use)? I think if I see a piece of code showing how to save and restore the state of a table object I will get it. Am I wrong in my assumption that I need to save the state of the table after I add a row and restore the state of the table on the next post back?
I appreciate anyone who can help me out with this.
To allow the users to enter these bullet points in a method where they would resemble what they would look like in a list, I build a two column "asp:table" with text boxes inserted in each cell. I provide a button for the user to add rows if they need to add more bullet points.
HOWEVER ..... when the button is clicked, the row is added to the table but a row previously is lost. I know this is VIEWSTATE management problem. The table is not being set as being "dirty" in the viewstate. I believe I need to do that within the button click event that is adding rows to the table.
HOWEVER ..... I cannot figure out how to do this. I have been reading about state mangement and I have been reading about serialization of objects (because that is one of the errors I get when I try to add the table object to the state).
Does anyone have a chunk of code in VB that shows how to add a table to the viewstate or the StateBag (whichever it is that I am supposed to use)? I think if I see a piece of code showing how to save and restore the state of a table object I will get it. Am I wrong in my assumption that I need to save the state of the table after I add a row and restore the state of the table on the next post back?
I appreciate anyone who can help me out with this.