title: Unable to use JsRuntime.InvokeAsync from OnAfterRenderAsync in Blazor Server-Side App
body: <p>I have a Blazor app and in the <code>OnAfterRenderAsync</code> I'm calling a method <code>PlayVideo()</code> which needs to call a JavaScript method.  In previous version of Blazor I was able to check the <code>context.IsConnected</code> property to ensure I could make the JavaScript call.  However, in the latest version of Blazor, this property has been removed.  Now, in when I try to make the JavaScript call from the PlayVideo() method, I get the following error message:</p>
  
  <p><code>JavaScript interop calls cannot be issued at this time. This is because the component is being prerendered and the page has not yet loaded in the browser or because the circuit is currently disconnected. Components must wrap any JavaScript interop calls in conditional logic to ensure those interop calls are not attempted during prerendering or while the client is disconnected.</code></p>
  
  <p>From what I've read though, calling JavaScript from the <code>OnAfterRenderAsync</code> method should work fine as it should be connected.  Is there a way to check now that I can make JavaScript call since the <code>context.IsConnected</code> property has been removed?</p>
  
  <p>Thank YOu</p>