Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends i have searched a lot but i wish i can find result here

here is the my code

i have n-repeater i have created blog but i want to refresh that repeater globally

suppose in india one person have added comment and within diff location that blog should be refreshed automatically


C#
case "commentreply":
                if (((TextBox)e.Item.FindControl("txtreply")).Text.ToString() != "")
                {
                    property.tag = 17;
                    property.favour = 0;
                    property.user_id = Convert.ToInt32(Session["user_id"].ToString());
                    property.blog_id = Convert.ToInt32(ViewState["blog_id"].ToString());
                    property.blog_content = ((TextBox)e.Item.FindControl("txtreply")).Text.ToString();
                    property.comment_id = Convert.ToInt32(((HiddenField)e.Item.FindControl("comment_id")).Value);
                    property.active = true;
                    bal.blog(property);

                }
                bindcomment();
                break;



and here is bind comment
C#
rptcomment.datsource=dt;
rptcomment.DataBind();


all working fine but i just want this additional task to do......repeater does not refresh globally
Posted
Updated 5-Aug-13 21:36pm
v3

This is a server side code and thus the repeater will only refresh when the browser pots back the page or gets the refreshed page again.
For the data to refresh automatically, you either need to poll the server in a defined interval to get the new data. You can do that easily using jQuery and AJAX. Or the other option, which should be used when you need real time updates (example chats, facebook notification), is to use push technology. SignalR[^] is a library which helps achieve this very elegantly. Checkout the link and and decide if that's what you need.

Hope that helps!
 
Share this answer
 
Comments
Dholakiya Ankit 6-Aug-13 5:37am    
5ed is it so? now get it.......
Ankur\m/ 6-Aug-13 5:56am    
I am sorry I do understand.
Dholakiya Ankit 6-Aug-13 6:01am    
hmmmm
refreshing-a-repeater-control-in-an-updatepanel-with-asp-net[^]

refreshing-repeater-control-aspnet-100009.aspx[^]

Although i am not sure but still check the links..hope it will help..
 
Share this answer
 
Comments
Dholakiya Ankit 6-Aug-13 4:17am    
thanks for reply but still i get stuck i want to refresh withing two pc's

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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