This method is not too good, the pressure on the server, because the system is internal personnel use, business is more complex, so some of the need to save the session, but the session has a failure time.
The code is as follows:
$ (function () { function post () { var bid = ' @ViewData ["bid] '; var cid= ' @ViewData ["CSID"]; $.ajax ({ type: "Post", ContentType: "Application/json", URL: "Index", data: { bid:bid, CID : Cid }, }) } setinterval (post, 10000);--this time can be changed
The backend first load time through the URL to get the corresponding ID saved, one side back rotation time to use
Public ActionResult Index (string ajaxid) { string id; id = request.querystring["bid"]; id = request.querystring["bid"]; if (AJAXID! = null) { id = ajaxid; } viewdata["id"] = ID;}
ASP. NET MVC Ajax rotation resolving session Expiration Time