سؤال

My current project is CRM based project, all the customer queries are stored in table.

All those records we are displaying in obout grid. To see the new query(new record) every time we are refreshing the entire page . Is their any way to show the new records with out postback

As the same functionality for mail inbox , when we receive the new mail it just show in out inbox without any post back . how to achieve this..

Thank You.

هل كانت مفيدة؟

المحلول

Have you tried use an Update Panel?

<asp:ScriptManager runat="server" />

<asp:UpdatePanel runat="server">
    <ContentTemplate>
       <obout:Grid id="grid1" runat="server"  CallbackMode="false" ... />
       <asp:Timer runat="server" id="Timer1" Interval="10000" OnTick="Timer1_Tick"></asp:Timer>
    </ContentTemplate>
</asp:UpdatePanel>

If the grid already exists, will be the easier solution to you. More information http://www.asp.net/web-forms/tutorials/aspnet-ajax

To automatically refresh your update panel, put a Timer control inside the update panel and set the Interval property with the time in milliseconds you want the Grid refreshed.

نصائح أخرى

You can use AJAX http://www.asp.net/ajax. I recommend you JQuery library http://jquery.com/ for your task.

An example of AJAX useing JQuery (http://api.jquery.com/category/ajax/):

$.get('ajax/test.html', function(data) {
    $('.result').html(data);
    alert('Load was performed.');
});

Please also look in to SignalR with jquery and Jqgrid. Which can push notifications to the browser. Thanks

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top