Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,

i have come up with web application and here i have got some quires on it, i have a page which displays list of items in a gridview from database, when database is get added with some more items by another user, i want grid view in my page to get update with newly added itemslist without page refresh.please help out friends with solution.

Regards

Vivek
Posted
Comments
Ganesan Senthilvel 8-Jul-12 23:39pm    
Without page refresh, need to think
Vivek Shankar 8-Jul-12 23:43pm    
example like facebook,


when database is get added with some more items by another user, i want grid view in my page to get update with newly added itemslist without page refresh.
All the while you just said 'I want'. Did you try? Think of it's feasibility? Do you know how ASP.NET webpage works? Page life cycle?

1. Updating a page without refresh is not possible in general, partial rendering/update of a page is.
2. For a web scenario, updating a page automatically based on some other user activity makes less sense but may be required at times. Less sense as, we can only have PULL (data from DB) mechanism here and NOT PUSH (data from DB). Thus, polling every few seconds and checking if any new data is there is the only way - leading to unnecessary load on server.

Now, for this polling, you need to use AJAX. Either XMLHttpRequest or ASP.NET AJAX.
Put a timer control and set it to send request every few seconds (eg: 60 seconds). Based on the response received update the UI.

Try out and post specific issue.
 
Share this answer
 
Comments
Prasad_Kulkarni 9-Jul-12 0:15am    
My 5
Add an Update panel And paste your gridview inside of it,Which will help to refresh the particular gridview instead of the whole page,
Then add a timer too,Inside Updatepanel;
Set timer interval ;
inside the timer_tick event,Add the code for filling gridview
 
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