简体   繁体   中英

Signal R and Update Panels

I have created a simple application using Signal R hubs approach in which I can perform CRUD operations on the normal ASP.Net Web forms grid view using entity Framework.The application works perfectly fine except for one nagging issue.After I make an update to the grid view,I have to force a page reload in the hub event updated method like this

 hub.client.eventUpdated = function (cevent) {

        window.location.reload(true);
     //I want to refresh an update panel here and not reload the page
      //Using a button to do a post back so that the update panel refreshes doesn't work 
      //intercepting update panel end request handler yields no success
          }

so that the page will reload on all clients.This causes a flicker as the page reloads.So I thought wrapping the grid view in an update panel would solve my issue since I have used update panels with success to to do partial page reloads.Once I use the update panel, the page will refresh without a flicker as expected but everything will then go wrong on all the clients.The update is not persisted to clients, only after doing a page refresh.My requirement would have been easy to achieve if I was just to show the updated changes in ready only table format to the clients.But I want to harness the CRUD capability of the grid view control to achieve my goal.

I have tried all hacks I know to force the update panel to refresh to no avail.So am I missing something here or what I want to achieve is impossible using a data bound control with Signal R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM