Onclick call function.

<a href="javascript: void(0);" @onclick="@(e => OpenProductViewer(product.Id))">@product.Name</a>
public void OpenProductViewer(string pId)
{

}

Onclick using div

                                    <div @onclick="@(e => AttachmentClicked(Convert.ToInt32(item.OrderId)))"><i class="fa fa-file-o"></i></div>
        public void AttachmentClicked(int pPurchaseOrderId)
        {
            Console.WriteLine("attachment clicked");
        }
Last modified: February 28, 2021

Author

Comments

Write a Reply or Comment