Hey!
I have a simple solution, but i am encountering some problems.
On my page I have 2 grids: rgItems and rgDeletedItems.
Columns in rgItems are: ItemName, ItemDetails (which is a link to a page with item details) and Delete (a button that deletes an item). In my DataBase Item has a property IsDeleted, so I delete it just by setting that property. When you click the button the IsDeleted property is set to true and I call rebind() on both grids (that is how I triger the needdatasource and grids refresh).
Columns in rgDeletedItems are: ItemName and button Renew (this button sets IsDelete to false and rebinds both grids, and that is how I move an item back to rgItems).
So in rgItems are Items with IsDeleted == true and in rgDeletedItems are items with IsDeleted = false.
Everyhing works well so far.
Let's make a scenario. We have 3 items RedItem, GreenItem and BlueItem, they are not deleted (IsDeleted == true on all of them), so when we come to page they are all in rgItems, the grid rgDeletedItems is emtpy. Let's say we delete RedItem. So in rgItems we now have 2 items, GreenItem and BlueItem and in grid rgDeletedItems we have RedItem. Then we click on a link on top grid let's say we look at the details of GreenItem, the page opens and everything is fine.
The problem is: when we click back in our browser to go back to the page with grids, initial grid will be loaded (3 item in rgItems and no items in rgDeletedItems), however if we refresh the page everything will be fine again. So the thing is that the back button loads the page that happend on first pageload (!IsPostBack), and it doesn't remember any of the changes that were made after.
Is this possible to make it so, the Page_Load would fire even when you click Back/Forward buttons in browser?
I am thankful for any assistance you can provide.
Sincerely, Jure
I have a simple solution, but i am encountering some problems.
On my page I have 2 grids: rgItems and rgDeletedItems.
Columns in rgItems are: ItemName, ItemDetails (which is a link to a page with item details) and Delete (a button that deletes an item). In my DataBase Item has a property IsDeleted, so I delete it just by setting that property. When you click the button the IsDeleted property is set to true and I call rebind() on both grids (that is how I triger the needdatasource and grids refresh).
Columns in rgDeletedItems are: ItemName and button Renew (this button sets IsDelete to false and rebinds both grids, and that is how I move an item back to rgItems).
So in rgItems are Items with IsDeleted == true and in rgDeletedItems are items with IsDeleted = false.
Everyhing works well so far.
Let's make a scenario. We have 3 items RedItem, GreenItem and BlueItem, they are not deleted (IsDeleted == true on all of them), so when we come to page they are all in rgItems, the grid rgDeletedItems is emtpy. Let's say we delete RedItem. So in rgItems we now have 2 items, GreenItem and BlueItem and in grid rgDeletedItems we have RedItem. Then we click on a link on top grid let's say we look at the details of GreenItem, the page opens and everything is fine.
The problem is: when we click back in our browser to go back to the page with grids, initial grid will be loaded (3 item in rgItems and no items in rgDeletedItems), however if we refresh the page everything will be fine again. So the thing is that the back button loads the page that happend on first pageload (!IsPostBack), and it doesn't remember any of the changes that were made after.
Is this possible to make it so, the Page_Load would fire even when you click Back/Forward buttons in browser?
I am thankful for any assistance you can provide.
Sincerely, Jure