Hi,
This may sound confusing, but ill try my best.
I dynamically create a table based on items added to a shopping list. Each time the ADD button is pressed, the item gets added to a text file, and the table on the web page is reloaded to see the added item. This works great.
What i have is a dynamically created checkbox in the last cell of each row that is created. I have a REMOVE button that will remove each item from the text file and table when the checkbox is selected.
What happens though, is when the checkbox is selected, and the REMOVE button is pressed, is seems as if the instance of the table is lost, as the following:
dim numtablerows as integer = me.tblShoppingCart.Rows.Count
returns 0. So, what ive done, is after the table is reloaded, i reference it to the session:
Session("Table") = tblShoppingCart
Then, i do:
tblShoppingCart = Session("Table")
dim numtablerows as integer = me.tblShoppingCart.Rows.Count
This returns the number of rows as being 7, which is correct. However, i cannot seem to access the right point in time to do Session("Table") = tblShoppingCart so that it ALSO stores which checkboxes are checked.
At which point in time in the rerendering cycle of the page should i right the table to the session. I tried it on the .disposed event, but it didnt call between the checking of the checkboxes or the init of the page.
I have not got a postback working on the checkboxes successfully either, is this what i should be looking towards?
Please assist me asap, if you need any further clarification, please let me know.
Regards,
Michelle
This may sound confusing, but ill try my best.
I dynamically create a table based on items added to a shopping list. Each time the ADD button is pressed, the item gets added to a text file, and the table on the web page is reloaded to see the added item. This works great.
What i have is a dynamically created checkbox in the last cell of each row that is created. I have a REMOVE button that will remove each item from the text file and table when the checkbox is selected.
What happens though, is when the checkbox is selected, and the REMOVE button is pressed, is seems as if the instance of the table is lost, as the following:
dim numtablerows as integer = me.tblShoppingCart.Rows.Count
returns 0. So, what ive done, is after the table is reloaded, i reference it to the session:
Session("Table") = tblShoppingCart
Then, i do:
tblShoppingCart = Session("Table")
dim numtablerows as integer = me.tblShoppingCart.Rows.Count
This returns the number of rows as being 7, which is correct. However, i cannot seem to access the right point in time to do Session("Table") = tblShoppingCart so that it ALSO stores which checkboxes are checked.
At which point in time in the rerendering cycle of the page should i right the table to the session. I tried it on the .disposed event, but it didnt call between the checking of the checkboxes or the init of the page.
I have not got a postback working on the checkboxes successfully either, is this what i should be looking towards?
Please assist me asap, if you need any further clarification, please let me know.
Regards,
Michelle