Hi asgar!
It looks like you’re trying to create an Edit link using @Html.ActionLink
and you have a composite key with monthr
and tennant
. In your code:
@Html.ActionLink("Edit", "Edit", new { item.monthr, item.tennant })
The issue is probably with how the parameters are being passed. In C#, when you use an anonymous object, you need to specify the property names, like this:
@Html.ActionLink("Edit", "Edit", new { monthr = item.monthr, tennant = item.tennant })
This way, both monthr
and tennant
will be included in the URL and sent to your Edit action. Also, make sure your controller’s Edit action is set up to accept both parameters:
public IActionResult Edit(int monthr, int tennant)
{
// Your code here
}
If this isn’t the error you’re seeing, could you please share the exact error message? That will help me figure out what’s going wrong and give you a more specific solution.
Hope this helps!