Hello
I have a gallery page which get images location url from DB and bind it to repeater.
The images can be added to gallery anytime.
Now lets say a user visit my gallery page, and after 2-3 minutes new images has been added on DB.
How can I make this images to appear on the user page without refreshing the entire page?
should I use UpdatePanel? and if so how can I trigger the updatePanel to check for new images every N minutes?
Thanks!!
You can use Update Panel so that the entire page will not refresh. To trigger the refresh, you need a timer/scheduler. You can use setInterval function.
http://www.w3schools.com/js/js_timing.asp
So, you can register a javascript function to simulate a hidden button in the
Update Panel by using jQueryclick function.
http://api.jquery.com/click/
Then handle the server side click event of that button to refresh the content of the
Update Panel.
No matter how much time you spend on coding. Wish you happy coding.
My Technical Blog
Marked as answer by shohamtal on Feb 24, 2013 08:19 PM
shohamtal
Member
17 Points
36 Posts
How to insert new images to page without refresh
Jan 27, 2013 12:34 AM|LINK
Hello
I have a gallery page which get images location url from DB and bind it to repeater.
The images can be added to gallery anytime.
Now lets say a user visit my gallery page, and after 2-3 minutes new images has been added on DB.
How can I make this images to appear on the user page without refreshing the entire page?
should I use UpdatePanel? and if so how can I trigger the updatePanel to check for new images every N minutes?
Thanks!!
CruzerB
Contributor
5399 Points
1098 Posts
Re: How to insert new images to page without refresh
Jan 27, 2013 08:38 AM|LINK
Hi,
You can use Update Panel so that the entire page will not refresh. To trigger the refresh, you need a timer/scheduler. You can use setInterval function.
http://www.w3schools.com/js/js_timing.asp
So, you can register a javascript function to simulate a hidden button in the Update Panel by using jQuery click function.
http://api.jquery.com/click/
Then handle the server side click event of that button to refresh the content of the Update Panel.
My Technical Blog
chetan.sarod...
All-Star
65749 Points
11148 Posts
Re: How to insert new images to page without refresh
Jan 28, 2013 02:47 AM|LINK
Refer this
http://msdn.microsoft.com/en-us/library/bb386454(v=vs.100).aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Song-Tian - ...
All-Star
43697 Points
4304 Posts
Microsoft
Re: How to insert new images to page without refresh
Jan 28, 2013 08:07 AM|LINK
Hi,
Another choice is javascript + web service. Any more question, please feel free to reply.
Feedback to us
Develop and promote your apps in Windows Store
shohamtal
Member
17 Points
36 Posts
Re: How to insert new images to page without refresh
Feb 24, 2013 08:20 PM|LINK
hey
sorry for the delay
thank you all!
great ideas