I am using Blazor server side to do subscribe to a newsletter. When I press the subscribe button, I see that the system has not bound the EmailAddress to the user entered email address. What am I missing?
@inherits InstaTranscribeServerSide.Layouts.SubscribeToNewsletterComponent
<div class="container">
<form class="mt-4">
<input type="email" name="email" placeholder="Enter your email address" text="@EmailAddress">
<button type="button" @onclick="SubscribeToNewsletterClick">
</button>
</form>
</div>
public class SubscribeToNewsletterComponent : InstaTranscribeComponentBase
{
[Inject] protected ILogger<SubscribeToNewsletter> logger { get; set; }
protected string EmailAddress { get; set; } = string.Empty;
protected async Task SubscribeToNewsletterClick()
{
try
{
await this.EmailSender.AddUpdateContactAsync(EmailAddress);
await JSRuntime.NotifySuccess($"You have been subscribed to our newsletter.");
}
catch (Exception exception)
{
await JSRuntime.NotifyError($"There was an error subscribing you to our newsletter.");
}
}
protected override async Task OnInitializedAsync()
{
}
}
screenshot showing emailaddress is blank:
screenshot showing emailaddress entered by user:

