I have created This PartialView Named _GreetingsSummary.cshtml
, everything is showing fine except that the button Use
is not working.
<div hidden>@Model List<Helper.BoldString></div>
<div style="border:1px solid black; border-radius:6px 6px;">
<div >
<div >
@foreach (var text in @Model)
{
<b>@text.BoldLetter</b>@text.RemainingString <br>
}
</div>
<div style="display: flex; align-items: center;">
<div hidden>@Helper.InMemoryInfoHolder.SelectedGreeting=@Model;</div>
<button asp-page="./Login">Use</button>
</div>
</div>
</div>
here is the calling of the same:
<div >
<div >SELECT ONE OF THE GREETING TO CREATE YOUR CARD</div>
@foreach (var item in Model.Greetings)
{
<partial name="_GreetingsSummary" model="@item" />
}
</div>
CodePudding user response:
I replaced <button>
tag with <a>
tag and the button started working fine.
CodePudding user response:
I think your problem that is what is HTML element do you want in "Use" case? Button or link, it's not problem in PartialView. Thanks.