Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a html table, and i am filling the table at runtime, i.e i am adding the rows at runtime. now when i click the save button which is an asp control, the page gets refreshed and the table returns to its initial stage, i.e it becomes empty.
can anyone help me with this, i don't want the table to go back to its initial stage, i want it to be displayed during save operation. please help.
Posted

If you don't need a complete postback/full page re-rendering (which is restoring the table to previous state), then you need to use some other technique to save data like XMLHttpRequest.

Keep the UI, intact, pass on the values to save via Javascript and save on server.
 
Share this answer
 
Comments
Espen Harlinn 6-Feb-11 11:57am    
Good advice, a 5, and he could stuff the result of the initial query in a session variable to further improve server side performance :)
put the loading function of the table on page load.
I think this will solve the problem.
 
Share this answer
 
Comments
linto_11 2-Feb-11 1:59am    
can u please help me with a small example. i am new to asp.
you should call the function in which the HTML table is dynamically created on page load event. at the moment you fill the table and press the button to save . but the button causes the post back. when the post backed page is loaded it is in the initial condition when it was loaded. so place the function in Page Load. i think it should do the trick.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900