ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  RazorChartViewer can not GetSenderClientId from jsChartViewer
Posted by Eric on Jul-20-2022 09:17
Hi there,

  I have a request to creat two chart in the same page and I want to refresh the two chart at the sametime.

  I send the update request at the front page, code as below:
  JsChartViewer.get('chart4').streamUpdate();
  JsChartViewer.get('chart5').streamUpdate();

  Then, I want to get the id of the JsChartViewer that sends the current HTTP request, but it didn't work, code as below:

  if (RazorChartViewer.IsStreamRequest(Request))
  {
    Console.WriteLine("clientID=" + RazorChartViewer.GetSenderClientId(Request));
    if(RazorChartViewer.GetSenderClientId(Request).Equals(realtimeChartViewer.ID))
       return File(realtimeChartViewer.StreamChart(), Response.ContentType);
       else
       return File(roundMeterChart.StreamChart(), Response.ContentType);
  }

  The clientID shows empty, so, how can i get the chart id from Http request? Thanks.

  **.net core mvc

  Re: RazorChartViewer can not GetSenderClientId from jsChartViewer
Posted by Peter Kwan on Jul-22-2022 14:13
Hi Eric,

Thank you very much for reporting this issue to us. We are able to reproduce this problem and is working on a fix. In the mean time, please obtain the clientID with the following code:

string clientID = Request.Query["cdDirectStream"];

The above is how ChartDirector obtains the clientID. For some reasons, it does not work inside our library, but it works if used directly in the razor page .cshtml.cs code.

Best Regards
Peter Kwan

  Re: RazorChartViewer can not GetSenderClientId from jsChartViewer
Posted by Eric on Jul-26-2022 17:15
I appreciate you very much for your help.
Now, I can catch the ID from the front page by using the code you provided.

Best Regards
Eric