I'm totally new to ASP.NET AJAX..writing my first AJAX enabled web app. In the app. The app is essentially a form that is displayed to the user in steps, like a wizard. Each step displays a continue button on the page, that when clicked, updates the page by setting the visible propery to true/false for the controls required/not required in the next step. All the controls reside in an update panel.
In the page load if !ISPostBack, I populate an asp.net table dynamically with items from a database, and allow users to enter a quantity they need in a textbox for each item. That works fine. Then when the user clicks the continue button, I set the visible propery on the table to false, and set other elemnts to true. that works. I also have a back button. If the user clicks the back button, I then set the table's visible propery to true again. The problem is that the table is now empty, since the page load event fires again. I only want to pull the items from the table on the intial page load. And then if the back button is clicked, the user should see the same table with their values filled in. This is easy in a non-AJAX site, since the table is stored in the viewstate.
What do I need to do in order to keep the table on the page, and keep the quantity textboxes populated with the user entered numbers when the back button is clicked? Surely I don't need to manually store the table in the viewstate do I? It seems to me that the pageload event should not fire at all since the page is AJAX enabled, and the only event that should fire is the button click event. There must be some fundamental aspect to ASP.NET AJAX that I am not getting...hopefully this all makes sense..if not tell me and I will try to clarify..
Nevermind...the problem is not AJAX related at all. It is that the rows and columns of an asp:Table are not stored in the ViewState...switching to a repeater...
No comments:
Post a Comment