Hi,@Saeed Pooladzadeh,you may follow these steps:
1,If you haven't enabled interactive render modes for entire app,you have to call @attribute [RenderModeInteractiveServer]
in current component
2, modify
<button @onclick="GenerateImage">Generate Image</button>
to
<button @onclick="GenerateImage" type="button">Generate Image</button>
, so that you could interact with server via signalr instead of sending post request to server
3,If your api endpoints are not hosted together with your blazor app,enable cors in your api project
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Ruikai Feng