Click here to Skip to main content
15,917,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
I have a datatable where text entered in textbox will be saved in temporary data table,without sending to database.
Now,when i click at other menu in the page and click back at the temporary data table,the datatable will be cleared because it reloads when we click at any menus in the page.
I want the page to be static,without reload/refresh.The page is in content holder in master page.

Any ideas guys?
Posted

You could use viewstate to ensure values are maintained or use AJAX and process out of band.
 
Share this answer
 
Comments
pwtc222 8-Sep-10 22:35pm    
How may i do that?any examples?
You can't make a page static every time a page gets postback it goes through entire page life cycle and everything gets reinitialized.

To avoid the post back you can use jQuery Ajax look for this in google you will find lot of articles on this. In case you want to retain the state of the datatable even after postback then you can store your datatable in Viewstate or Session

Remember google is your friend :)
 
Share this answer
 
Hi,

You can create a static class, with that temporary data table in it. Make sure the temporary data table is also static.

If you do this, your data will not get lost when u switch between different pages.

Try this. This may help you.

Regards,
Suresh
 
Share this answer
 
Comments
pwtc222 9-Sep-10 2:07am    
thats what i'm asking,i want to make the page static..how may i do it?
sureshbalachander 9-Sep-10 3:56am    
Do not make the page as Static. Create a Class and make it as Static.

Here is the introduction about static http://www.codeproject.com/KB/cs/C__20_static_class.aspx

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