I have an ASP.NET webform with a simple label. I can change the label's visibility and text on page load, or on a button press/event with no problem.
However, when I call returnMessage() on a SignalR event the method runs fully but the page does not update with the new text.
private void returnMessage(string message)
{
lblError.Visible = true;
lblError.Text = message;
}
Here's how SignalR calls the method:
HubProxyRegister.On<string>("UserAccountReturnMessage", (message) =>
{ returnMessage(message); });
Here's the blank page with the label:
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblError" runat="server" Text="Error:" Visible="False"></asp:Label>
</div>
</form>
</body>
Do I need to call some sort of a postback to show the updated label text since Signalr is calling returnMessage() instead of a user event?