Whenever I click on the anchor tag, it does not trigger the OnGetDownloadFile(). It triggers the OnGet() instead. Am I doing something wrong?
<form method="post" class="needs-validation" novalidate>
<div id="input_options" class="mt-4">
<label id="lblSelectedRad" class="fw-bold my-2">
Multiple Users
</label>
<div id="input_options_up" class="row align-items-center mb-4">
<div class="col-2">
<label for="inputUserIDPrefix">
User ID Prefix:
</label>
</div>
<div class="col-9">
<input id="inputUserIDPrefix" name="UserIDPrefix" class="form-control w-25" required />
<div class="invalid-feedback">
Please input the User ID Prefix.
</div>
</div>
</div>
<div id="input_options_nou" class="row align-items-center mb-4">
<div class="col-2">
<label for="inputNoOfUsers">
Number of Users:
</label>
</div>
<div class="col-9">
<input id="inputNoOfUsers" name="NoOfUsers" type="number" min="2" class="form-control w-25" required />
<div class="invalid-feedback">
Please input the Number of Users.
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-clean" onclick="history.back()">Back</button>
<button type="submit" class="btn btn-primary" asp-page-handler="Submit">Create</button>
</div>
</div>
<div id="create_user_cont" class="m-t2">
@{
if (Model.CreateAccount is not null)
{
<table class="table">
<thead class="table-dark">
<tr>
<th>Generated By</th>
<th>Generated Date</th>
<th>Status</th>
<th>File</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Model.CreateAccount.UserID / @Model.CreateAccount.UserName</td>
<td>@Model.CreateAccount.GeneratedDate.ToString("dd-MMM-yy hh:mm:ss")</td>
<td>@Model.CreateAccount.Status</td>
<td><a asp-page-handler="DownloadFile" asp-page="/CreateUserAcc">sampleFile.pdf</a></td>
</tr>
</tbody>
</table>
}
}
</div>
</form>